Initial LCH-to-RGB functions
In the main public API:
@use <'path/to>/blend';
Functions:
blend.lch(65% 75 0)
with optional alphablend.lch(10% 15 280, 85%)
, returns a Sass color
Config: $gamut-correct
true
[default]: Chroma is reduced until in-gamutfalse
: Individual RGB channels will be clippednull
: Returnnull
for out-of-gamut colors
If you want more explicit control,
use <path/to>/blend/sass/lab/lch
,
and access several functions directly:
lch.to-rgb()
does the conversion math on an array of channelslch.in-gamut()
returns either the converted channels
ornull
for out-of-gamut colorslch.gamut-correct()
uses chroma-reduction to get a color in-gamutlch.color()
takes LCH input and returns a Sass color
based on the chosen form of gamut-correction