If you want to learn more about CSS color spaces
and the tradeoff they provide,
or if you’re just interested in the new Sass functionality,
I’ve written about it
on the Sass Blog.
Some of the highlights:
- Sass colors have a ‘space’ that they are defined in.
We can inspect that using
color.space().
- A color’s space doesn’t change unless we explicitly convert between spaces
using
color.to-space().
- Out-of-gamut channels are also preserved
unless we explicitly adjust a color into a specific gamut
using
color.to-gamut().
- Color manipulation and inspection functions
like
color.adjust() or color.channel()
accept a $space parameter for making adjustments or inspecting
in an arbitrary color space.