Skip to content

Commit

Permalink
feat: upgrade to new sass colors functions
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-berlin committed Nov 1, 2024
1 parent 8ea038f commit b624ef8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $is-test: false !default;
/// @author Felix Scholze
/// @since v1.5.0
@function hex-to-rgb-values($color) {
@return color.red($color) + ", " + color.green($color) + ", " + color.blue($color);
@return color.channel($color, 'red', $space: rgb) + ", " + color.channel($color, 'green', $space: rgb) + ", " + color.channel($color, 'blue', $space: rgb);
}

/// Convert HEX colors to RGB (space-separated values)
Expand All @@ -25,7 +25,7 @@ $is-test: false !default;
/// @author Felix Scholze
/// @since v1.5.0
@function hex-to-rgb($color, $alpha: false) {
@return string.unquote("rgb") + "(" + (color.red($color) color.green($color) color.blue($color)) + if($alpha, " / " + $alpha, "") + ")";
@return string.unquote("rgb") + "(" + (color.channel($color, 'red', $space: rgb) color.channel($color, 'green', $space: rgb) color.channel($color, 'blue', $space: rgb)) + if($alpha, " / " + $alpha, "") + ")";
}

/// Generate shades in light and dark from a base color.
Expand Down

0 comments on commit b624ef8

Please sign in to comment.