Re: [community-group] How should tools process higher fidelity values than they can handle internally? (#157)

This doesn't have to be super complicated, but one thing is certain, tagging colour data with a colour space is an absolute must - especially if the goal is making universal interchange format. Otherwise, colour data will be meaningless and subject to open interpretation. Here's my recommendation with respects to colour:

* **Colour Model**: Always RGB channels, with an optional opacity channel.
* **Data Type**: IEEE 754 floating point representation, support at least [double](https://en.wikipedia.org/wiki/Double-precision_floating-point_format). That will cover most bases in terms of precision, as `double` has a 53 bit mantissa.
* **Data Range**: Colour and opacity channels should have a normalised range between [0, 1]. Theoretically, extended ranges is possible represent for colour (i.e. values outside the normalised range [0, 1], [see extended sRGB as an example](https://developer.apple.com/documentation/appkit/nscolorspace/1644175-extendedsrgbcolorspace?language=objc)), but in the interest of simplicity, we should  keep everything clamped to [0, 1]. If you need extended values, then use a  colour space with a wider gamut, which leads me to the next point...
* **Colour Space**: Finally, colours need to be tagged with a colour space. This is perhaps the most important metadata, because colour spaces make colours  unambiguous, and will appear consistently the same everywhere. Support for limited subset of colour spaces should be enough, i propose support for [sRGB](https://en.wikipedia.org/wiki/SRGB), [DisplayP3](https://developer.apple.com/documentation/coregraphics/kcgcolorspacedisplayp3?language=objc), and [ACEScg](https://en.wikipedia.org/wiki/Academy_Color_Encoding_System#ACEScg). We don't have to embed an entire ICC colour profiles, supplying the colour space as a simple enumeration value is enough.

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


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

Received on Friday, 8 July 2022 01:07:44 UTC