mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
优化QrCodeUtil
This commit is contained in:
parent
9543012fec
commit
62735daa36
@ -147,7 +147,9 @@ public class QrConfig {
|
||||
* @since 5.1.1
|
||||
*/
|
||||
public QrConfig setForeColor(Color foreColor) {
|
||||
if(null != foreColor){
|
||||
if(null == foreColor){
|
||||
this.foreColor = null;
|
||||
} else {
|
||||
this.foreColor = foreColor.getRGB();
|
||||
}
|
||||
return this;
|
||||
|
@ -135,8 +135,8 @@ public class QrCodeUtilTest {
|
||||
@Test
|
||||
public void generateAsciiArtTest() {
|
||||
QrConfig qrConfig = QrConfig.create()
|
||||
.setForeColor(new Color(255,0,255))
|
||||
.setBackColor(new Color(0,255,0))
|
||||
.setForeColor(Color.BLUE)
|
||||
.setBackColor(Color.MAGENTA)
|
||||
.setWidth(0)
|
||||
.setHeight(0).setMargin(1);
|
||||
String asciiArt = QrCodeUtil.generateAsAsciiArt("https://hutool.cn/",qrConfig);
|
||||
|
Loading…
x
Reference in New Issue
Block a user