Skip to content

Commit

Permalink
feat: use oPrivateColorGetTone
Browse files Browse the repository at this point in the history
  • Loading branch information
frshwtr committed Dec 3, 2024
1 parent 78d315c commit b2bbc83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
///
/// @param {String} $color-name - the name of the color to be shaded
/// @param {Number} $brightness - the brightness value of the new color, 0-100
@function oColorsGetTone($color-name, $brightness) {
@function oPrivateColorsGetTone($color-name, $brightness) {
// Find palette colour information.
$color: oColorsByName($color-name);
$color: oPrivateFoundationGet($color-name);
$color-map: map-get($_o-pf-colors-palette, $color-name);
$color-meta: map-get($color-map, 'meta');

Expand All @@ -87,7 +87,7 @@
@if (hue($color) == 0 and saturation($color) == 0) {
@return _oColorsError('"#{$color-name}" does not support tones. ' +
'Use a mix instead: ' +
'`oColorsMix(\'#{$color-name}\', $percentage: #{$brightness})`');
'`oPrivateColorsMix(\'#{$color-name}\', $percentage: #{$brightness})`');
}

// Error for any palette colour which hasn't been configured to allow tones.
Expand Down Expand Up @@ -128,7 +128,7 @@
// Check the given colour against the tone to find the tone brightness.
$brightness: 0;
@while $brightness <= 100 {
@if(inspect(oColorsGetTone($tone-color, $brightness)) == inspect($color)) {
@if(inspect(oPrivateColorsGetTone($tone-color, $brightness)) == inspect($color)) {
@return (
'color-name': $tone-color,
'brightness': $brightness
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
@each $color-name, $tone-values in $_o-pf-colors-default-palette-tones {
@each $value in $tone-values {
$name: "#{$color-name}-#{$value}";
$tone: oColorsGetTone($color-name, $value);
$tone: oPrivateColorsGetTone($color-name, $value);
@include oPrivateColorsSetColor('o-colors/#{$name}', $tone);
}
}
Expand Down

0 comments on commit b2bbc83

Please sign in to comment.