Is there a way to extract the H, S, L values from a hex color in SASS and assign them to separate CSS variables?
$colors: ( "primary": $primary, "secondary": $secondary) !default;
:root {
@each $color, $value in $colors {
--#{$color}-h: #{$value};
--#{$color}-s: #{$value};
--#{$color}-l: #{$value};
}
}
The current code mentioned above duplicates the color 3 times. Is there a more efficient way to achieve this in SASS?