Skip to content

Commit ab2042c

Browse files
committed
if text is color then look directly for nearest palette neighbour
1 parent d320cb8 commit ab2042c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/common/utils/colorHash.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ export function textToColorHash({
119119
return color.hex().toString();
120120
}
121121

122-
color = getColorcode(stringToHexColorHash(text)) as Color;
122+
if (!color) {
123+
color = getColorcode(stringToHexColorHash(text)) as Color;
124+
}
123125

124126
if (options.enabledColors === "all" && color) {
125127
// all colors are allowed as return value

0 commit comments

Comments
 (0)