fix comment

This commit is contained in:
Looly 2022-09-15 01:12:17 +08:00
parent d1472f2bfe
commit 3fd1ebe0f5
2 changed files with 27 additions and 22 deletions

View File

@ -40,7 +40,7 @@ public class QrCodeUtil {
public static final String QR_TYPE_SVG = "svg";// SVG矢量图格式
public static final String QR_TYPE_TXT = "txt";// Ascii Art字符画文本
private static final AnsiColors ansiColors= new AnsiColors(AnsiColors.BitDepth.EIGHT);
private static final AnsiColors ansiColors = new AnsiColors(AnsiColors.BitDepth.EIGHT);
/**
* 生成代 logo 图片的 Base64 编码格式的二维码 String 形式表示
@ -162,6 +162,7 @@ public class QrCodeUtil {
* @param content 内容
* @param width 宽度单位字符的大小
* @param height 高度单位字符的大小
* @param margin 边距大小1~4
* @return ASCII Art字符画形式的二维码
* @since 5.8.6
*/
@ -563,6 +564,7 @@ public class QrCodeUtil {
* @param matrix BitMatrix
* @param foreColor 前景色
* @param backColor 背景色(null表示透明背景)
* @param logoImg LOGO图片
* @param ratio 二维码中的Logo缩放的比例系数如5表示长宽最小值的1/5
* @return SVG矢量图字符串
* @since 5.8.6
@ -610,7 +612,7 @@ public class QrCodeUtil {
result.append("xmlns=\"http://www.w3.org/2000/svg\" \n");
result.append("xmlns:xlink=\"http://www.w3.org/1999/xlink\" >\n");
result.append("<path d=\"").append(sb).append("\" ");
if (foreColor!=null){
if (foreColor != null) {
Color fore = new Color(foreColor, true);
result.append("stroke=\"rgba(").append(fore.getRed()).append(",").append(fore.getGreen()).append(",").append(fore.getBlue()).append(",").append(fore.getAlpha()).append(")\"");
}
@ -626,6 +628,7 @@ public class QrCodeUtil {
* BitMatrix转ASCII Art字符画形式的二维码
*
* @param bitMatrix BitMatrix
* @param qrConfig QR设置
* @return ASCII Art字符画形式的二维码
* @since 5.8.6
*/
@ -658,7 +661,9 @@ public class QrCodeUtil {
return builder.toString();
}
/* *//**
/* */
/**
* rgb转AnsiElement
*
* @param rgb rgb颜色值
@ -666,7 +671,7 @@ public class QrCodeUtil {
* @return AnsiElement
* @since 5.8.6
*/
private static AnsiElement rgbToAnsi8BitElement(int rgb,ForeOrBack foreOrBack) {
private static AnsiElement rgbToAnsi8BitElement(int rgb, ForeOrBack foreOrBack) {
return ansiColors.findClosest(new Color(rgb)).toAnsiElement(foreOrBack);
}

View File

@ -28,15 +28,15 @@ public class QrConfig {
/**
* 宽度单位像素或
* <div>当二维码类型为一般图片或者SVG时单位是像素<div/>
* <div>当二维码类型Ascii Art字符画时单位是字符的大小<div/>
* <p>当二维码类型为一般图片或者SVG时单位是像素</p>
* <p>当二维码类型Ascii Art字符画时单位是字符的大小</p>
*/
protected int width;
/**
* 高度单位像素或
* <div>当二维码类型为一般图片或者SVG时单位是像素<div/>
* <div>当二维码类型Ascii Art字符画时单位是字符的大小<div/>
* <p>当二维码类型为一般图片或者SVG时单位是像素</p>
* <p>当二维码类型Ascii Art字符画时单位是字符的大小</p>
*/
protected int height;
/** 前景色(二维码颜色) */