Skip to content

Commit 483a071

Browse files
authored
fix(color-picker): 修复 alpha 精度丢失问题 (#3390)
* fix(color-picker): 修复 alpha 精度丢失问题 * chore(color-picker): remote comment
1 parent 58b67fc commit 483a071

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/color-picker/color-picker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const getFormatList = (format, color) => {
4747

4848
const cur = FORMAT_MAP[format];
4949
if (cur) {
50-
return [...cur.slice(0, cur.length - 1), `${color.alpha * 100}%`];
50+
return [...cur.slice(0, cur.length - 1), `${Math.round(color.alpha * 100)}%`];
5151
}
5252
return FORMAT_MAP.RGB;
5353
};

0 commit comments

Comments
 (0)