Skip to content

Commit b1692de

Browse files
committed
Taking hex function out
1 parent 7dd2b76 commit b1692de

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib_src/misc/colors.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ function rgb2hex(rgb) {
3636
return rgb
3737
} else {
3838
rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/)
39-
function hex(x) {
40-
return ("0" + parseInt(x).toString(16)).slice(-2);
41-
}
4239
return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
4340
}
4441
}
42+
43+
function hex(x) {
44+
return ("0" + parseInt(x).toString(16)).slice(-2);
45+
}

0 commit comments

Comments
 (0)