From 41b0d0497988274057fc2512c822a6bc9d2d3ebd Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 6 Aug 2025 16:40:56 +0200 Subject: Switch to tab indentation --- src/_functions.scss | 86 ++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'src/_functions.scss') diff --git a/src/_functions.scss b/src/_functions.scss index b41609e..ec1f9d8 100644 --- a/src/_functions.scss +++ b/src/_functions.scss @@ -8,63 +8,63 @@ @use 'apca'; @function palette($base-color, $levels, $ref-color: $base-color) { - $base-lch: color.to-space($base-color, oklch); - $ref-lch: color.to-space($ref-color, oklch); + $base-lch: color.to-space($base-color, oklch); + $ref-lch: color.to-space($ref-color, oklch); - $ref-l: color.channel($ref-lch, 'lightness'); - $ref-y: apca.sRGB_to_Y($ref-lch); + $ref-l: color.channel($ref-lch, 'lightness'); + $ref-y: apca.sRGB_to_Y($ref-lch); - $black-y: apca.sRGB_to_Y(#000); - $white-y: apca.sRGB_to_Y(#fff); + $black-y: apca.sRGB_to_Y(#000); + $white-y: apca.sRGB_to_Y(#fff); - $palette: (); + $palette: (); - @each $key, $level in $levels { - $color: list.nth($level, 1); - $y: 0; - $c: 1; - $h: 0deg; + @each $key, $level in $levels { + $color: list.nth($level, 1); + $y: 0; + $c: 1; + $h: 0deg; - @if list.length($level) > 1 { - $c: list.nth($level, 2); - } - @if list.length($level) > 2 { - $h: list.nth($level, 3); - } + @if list.length($level) > 1 { + $c: list.nth($level, 2); + } + @if list.length($level) > 2 { + $h: list.nth($level, 3); + } - @if meta.type-of($color) != 'color' { - $y: apca.reverse($color, $ref-y); - $l: color.channel($base-lch, 'lightness'); + @if meta.type-of($color) != 'color' { + $y: apca.reverse($color, $ref-y); + $l: color.channel($base-lch, 'lightness'); - @if $y != false { - $l: color.channel(apca.Y_to_sRGB($y), 'lightness', oklch); - } @else { - $y: $ref-y; - } + @if $y != false { + $l: color.channel(apca.Y_to_sRGB($y), 'lightness', oklch); + } @else { + $y: $ref-y; + } - $color: oklch($l ($c * color.channel($base-lch, 'chroma')) ($h + color.channel($base-lch, 'hue'))); - } @else { - $y: apca.sRGB_to_Y($color); - } + $color: oklch($l ($c * color.channel($base-lch, 'chroma')) ($h + color.channel($base-lch, 'hue'))); + } @else { + $y: apca.sRGB_to_Y($color); + } - $contrast-black: apca.contrast($black-y, $y); - $contrast-white: apca.contrast($white-y, $y); + $contrast-black: apca.contrast($black-y, $y); + $contrast-white: apca.contrast($white-y, $y); - $palette: map.set($palette, $key, $color); - $palette: map.set($palette, #{$key}-text, if(math.abs($contrast-black) > math.abs($contrast-white), #000, #fff)); - } + $palette: map.set($palette, $key, $color); + $palette: map.set($palette, #{$key}-text, if(math.abs($contrast-black) > math.abs($contrast-white), #000, #fff)); + } - @return $palette; + @return $palette; } @function transparent-palette($color, $text, $alphas) { - $palette: ( - --text: $text, - ); + $palette: ( + --text: $text, + ); - @each $key, $alpha in $alphas { - $palette: map.set($palette, $key, rgba($color, $alpha)); - } + @each $key, $alpha in $alphas { + $palette: map.set($palette, $key, rgba($color, $alpha)); + } - @return $palette; + @return $palette; } -- cgit v1.2.3-70-g09d2