-
Leon Arnott authored
The (mix:) macro now uses OKLCH by default, and takes an optional first string that lets other colour models be used instead. Originally, this was going to be implemented by simply using the browser to mix the colours, by creating a hidden element, giving it the two colours using the CSS color-mix() function, then using getComputedStyle() to obtain the mixed colour. However, despite being rather effective, because of the slowness and potential brittleness of this approach, I instead decided to implement the CSSWG colour mixing algorithms myself. This also contains support for specifying the hue interpolation direction for OKLCH, LCH and HSL, although this option is currently not exposed to (mix:).
0dc19e330cd7
Loading