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

I might be missing something but isn't this an over complication of the issue?

It should be sufficient to have these two things :

- srgb support to accelerate implementations
- a color space to express all possible colors
- a format that can ideally express both

Design tokens are never a final product, so there is no need to support all complexities around color. It is only important to be able to accurately record all possible colors.

```json
{
  "srgb-color": {
    "$type": "color",
    "$value": {
      "colorSpace": "srgb",
      "channels": [0.1, 0.2, 0.3],
      "alpha": 0.6
    }
  },
  "wide-gamut-color": {
    "$type": "color",
    "$value": {
      "colorSpace": "xyz-d65",
      "channels": [0.1, 0.2, 0.3],
      "alpha": 0.6
    }
  }
}
```

When writing tokens to a file design tools can "gravitate" towards `srgb`.
If the color is in gamut for `srgb` it must be stored with `"colorSpace": "srgb",`.
Only when out of gamut must it be `"colorSpace": "xyz-d65",`.

This will create a smoother transition for tools that do not have color space support today.

----

This format can be extended in the future to allow custom color spaces with arbitrary numbers of channels.

This is mainly useful for print where spot inks, varnishes, ... can be expressed with extra color channels.

----

It should not be the concern of the design tokens file format how a designer picks a color.
This can be a color picker for `hwb`, `oklch`, `hsl`, `rgb`, .....

It should also not be the concern of the design tokens file format how the color token is used. Translation tools are responsible for generating the correct color format for final use.

-----

But as I said before, maybe I am missing the point here :)

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


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

Received on Thursday, 1 December 2022 09:19:40 UTC