Ogeon/palette

CSS color module level 5 color space support

Ogeon opened this issue · 0 comments

Description

CSS has a few variants of color spaces that aren't yet supported in Palette. These should be added.

XYZ:

  • xyz, xyz-d65 - Xyz or explicitly Xyz<D65>
  • xyz-d50 - Xyz<D50>

RGB:

  • Hex color - Srgb::<u8>::from_str
  • Named color - palette::named
  • rgb() and rgba() - Srgb, Srgba
  • srgb - Rgb, Srgb or explicitly Rgb<Srgb>
  • srgb-linear - LinSrgb
  • display-p3 - Separate issue: #367, implemented in #412
  • a98-rgb - Implemented in #411
  • prophoto-rgb - Implemented in #413
  • rec2020 - Implemented in #410

Other:

  • hsl() and hsla() - Hsl<Srgb>, Hsla<Srgb>
  • hwb() - Hwb<Srgb>
  • lab() - Lab<D50>
  • lch() - Lch<D50>
  • oklab() - Oklab
  • oklch() - Oklch
  • device-cmyk (naive or value container) - Separate issue: #6

https://www.w3.org/TR/css-color-5

Motivation

CSS is widely used and providing matching options makes it easier for applications to use Palette as the color management backend when reading and writing CSS color syntax.