Skip to content

Commit 1ee6fb0

Browse files
Fixing css color names not working. (wrong variable used)
1 parent f7b071c commit 1ee6fb0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/plugin/composables/levelColors.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ function levelPercentage(
108108
* Converts the color to HSL values
109109
*/
110110
function convertToHSL(color: string): string {
111+
// console.log('convertToHSL', color);
111112
let newColor: HEXColor | RGBColor | HSLColor = checkColorNames(color);
112113
let h = 0;
113114
let s = 0;
@@ -118,7 +119,7 @@ function convertToHSL(color: string): string {
118119

119120
// Convert hex color to RGB if necessary
120121
if (newColor.substring(0, 1) === '#') {
121-
newColor = hexToRGB(color) as RGBColor;
122+
newColor = hexToRGB(newColor) as RGBColor;
122123
}
123124
// Convert RGB to array values if necessary
124125
else if (newColor.includes('rgb')) {
@@ -328,9 +329,14 @@ function checkColorNames(color: string): HEXColor {
328329
};
329330
let response = color;
330331

332+
// console.log({ color });
331333
Object.entries(colors).forEach(([key, value]) => {
332334
if (color.toLowerCase() == key.toLowerCase()) {
333335
response = value;
336+
console.log(color.toLowerCase());
337+
console.log(key.toLowerCase());
338+
console.log(value);
339+
return;
334340
}
335341
});
336342

0 commit comments

Comments
 (0)