From 4ecdedcdd15724967c946a498b1ebff3b5cc76fa Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 15 Oct 2024 18:06:26 +0200 Subject: Design colors --- src/_functions.scss | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/_functions.scss') diff --git a/src/_functions.scss b/src/_functions.scss index 07d997b..523aa84 100644 --- a/src/_functions.scss +++ b/src/_functions.scss @@ -77,6 +77,11 @@ $black-y: iro-colors.apca_sRGB_to_Y(#000); $white-y: iro-colors.apca_sRGB_to_Y(#fff); + $chroma-inv: false; + @if $chroma-range < 0 { + $chroma-inv: true; + $chroma-range: -1 * $chroma-range; + } $chroma-easing: meta.get-function(config.$palette-chroma-easing, $module: easing); $palette: (); @@ -94,6 +99,9 @@ @if $chroma-range != 1 { $c: if($ref-l > 50%, math.clamp(0, math.div($contrast, $cmax), 1), -1 * math.clamp(-1, math.div($contrast, $cmax), 0)); + @if $chroma-inv { + $c: 1 - $c; + } $c: meta.call($chroma-easing, $c); $c: $chroma-range + (1 - $chroma-range) * $c; } -- cgit v1.3.1