Re: [community-group] Loosen up the color type (#79)

The current proposal is limited in 3 ways (not 2) :

- only 3 channels + alpha
- only 8bit per channel
- only supports sRGB

This actually makes it less suitable in terms of interoperability.

The [CSS `color()` function](
https://www.w3.org/TR/css-color-4/#funcdef-color) has non of these problems.
It is still a single format but it can express :

- any number of channels + alpha
- 16bit per channel (and higher)
- any color space

```css
color(rec2020 0.42053 0.979780 0.00579);
```

This could also be broken down to a "raw" format :

```json
{
  "colorSpace": "rec2020",
  "channels": [
    0.42053,
    0.979780,
    0.00579
  ],
  "alpha": "1"
}
```

This will ensure interoperability of color information from the start.
Without a format like this an export to design tokens will be lossy.

The initial specification can still start with only `srgb` as a supported color space.
But the format doesn't have to change when other colors spaces are added.

With the current format early adopters of the specification would eventually need to support two color formats and/or go through migrations.

Support for more color spaces is part of [interop 2022](https://webkit.org/blog/12288/working-together-on-interop-2022/) and large parts are already supported by webkit.

-- 
GitHub Notification of comment by romainmenke
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/79#issuecomment-1073029675 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 19 March 2022 15:28:35 UTC