sass-planifolia

Vanilla Sass helper functions
git clone https://git.ce9e.org/sass-planifolia.git

commit
fb06223fe4f1ca5a37a9bc64bafb3e87f8faabb7
parent
ce65ab0e4647a4597ebdd4277a0d0cd60d31f485
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2017-10-17 17:21
change saturation hsl

Diffstat

M CHANGES.md 1 +
M sass/color.scss 6 ++----

2 files changed, 3 insertions, 4 deletions


diff --git a/CHANGES.md b/CHANGES.md

@@ -2,6 +2,7 @@
    2     2 ------------------
    3     3 
    4     4 - color: add support for HSLab and HSLuv color spaces
   -1     5 - color: change behavior of chroma/saturation in HSL color space
    5     6 
    6     7 0.4.2 (2017-07-21)
    7     8 ------------------

diff --git a/sass/color.scss b/sass/color.scss

@@ -251,8 +251,7 @@ $planifolia-colorspace: 'lab' !default;
  251   251     $max: _pf-max-chroma(nth($lch, 1), nth($lch, 3), 'luv');
  252   252     @return (nth($lch, 1), nth($lch, 2) / $max * 100, nth($lch, 3));
  253   253   } @else if $colorspace == 'hsl' {
  254    -1     $chroma: saturation($color) * lightness($color) / 100%;
  255    -1     @return (lightness($color) / 1%, $chroma / 1%, hue($color));
   -1   254     @return (lightness($color) / 1%, saturation($color) / 1%, hue($color));
  256   255   } @else if $colorspace == 'yuv' {
  257   256     $yuv: _pf-to-yuv($color);
  258   257     @return _pf-lab-to-lch($yuv);
@@ -277,8 +276,7 @@ $planifolia-colorspace: 'lab' !default;
  277   276     $max: _pf-max-chroma($lightness, $hue, 'luv');
  278   277     @return _lch-unclipped($lightness, $chroma * $max / 100, $hue, 'luv');
  279   278   } @else if $colorspace == 'hsl' {
  280    -1     $saturation: if($lightness == 0, 0, $chroma / $lightness * 100);
  281    -1     $color: hsl($hue, $saturation * 1%, $lightness * 1%);
   -1   279     $color: hsl($hue, $chroma * 1%, $lightness * 1%);
  282   280     @return (red($color), green($color), blue($color));
  283   281   } @else if $colorspace == 'yuv' {
  284   282     $yuv: _pf-lch-to-lab(($lightness, $chroma, $hue));