File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ function levelPercentage(
108108 * Converts the color to HSL values
109109 */
110110function 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
You can’t perform that action at this time.
0 commit comments