From 4ecdedcdd15724967c946a498b1ebff3b5cc76fa Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 15 Oct 2024 18:06:26 +0200 Subject: Design colors --- src/_config.scss | 4 ++-- src/_functions.scss | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/_config.scss b/src/_config.scss index 948f919..c827c14 100644 --- a/src/_config.scss +++ b/src/_config.scss @@ -197,12 +197,12 @@ $theme-dark: ( ), --ranges: ( - --full: 1, + --full: .4, --muted: .3, ), --palettes: ( - --base: hsl(257, 6%, 18%) --grays --full, + --base: hsl(257, 15%, 19.5%) --grays --full, --blue: oklch(56% .16 265.25) --colors --muted, --purple: oklch(56% .16 305.58) --colors --muted, --red: oklch(56% .16 18.69) --colors --muted, 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.2.3-70-g09d2