🎨 Expanded support for color spaces
Today we offer support for these color spaces:
Hex
RGBA
HSLA
We've had several requests to support these color spaces:
LCH
OKLCH
OKLAB
HSB
CIELAB
HSLuv
CMYK
XYZ065
😬 The reality
Figma and the Design Tokens Community Group specifications prefer a hex code, so the plugin does some "work under the hood" to translate non-hex color spaces into a code that meets these specifications.
💭 How might we...
Bring the benefits in uniform perceived lightness and accessibility to designers working with these new color spaces in the plugin in an output that is compatible with Figma and the DTCG W3C specifications
💬 Feedback that is valuable
How does this issue impact your day-to-day workflow?
What workarounds do you have?
Log in to comment and vote
Comments22
Tim Chinye
May 26, 2024
I made an account just to upvote this.
I hate to be that guy but OKLch "is the future", and as a developer, I need to constantly look forward and design my applications according to that future!
Sam - Tokens Studio
May 29, 2024
Thank you for making the effort to help us prioritize 🫶
Michael Gamble
Jan 9, 2025
I would like to +1 this comment - building out color pallettes using the oklch color space is considered the new approach in color theory that better supports Accesibility contrast ratios - I adopted this in our companies design system after listening to industry thought leaders like Ashley Seto at Config 2023 present about the topic.
Seeing the consistency in how the progression is in comparison to just LCH across multiple colors scaling at the same ratios. Old school LCH stepping provides way less consistent visual results and looks so much flatter / gray - where is the OKLCH approach perserves the color vibrancies between each step and creates way more consistent results when looking at the modifier across multiple colors (for anyone intersted you can play with the open source tool at
https://leonardocolor.io/
TLDR
OKLch is absolutely the future.
Roman Turov
Apr 12, 2024
Oklch must have!
Sam - Tokens Studio
Apr 17, 2024
Make sure you upvote on the request if you haven't already!
Tim Chinye
May 26, 2024
"What workarounds do you have?"
As of now, I've opted to using http://oklch.com/ to convert between colour spaces.
Onur Orhon
Jul 30, 2024
Color modifier is a very powerful feature of the plugin, and more color spaces would certainly make it more robust. OKLCH and CIELAB specifically, are important to me.
Sam - Tokens Studio
Mar 22, 2024
This issue was created based on feedback from Github issues
1574
1608
1637
1914
2255
2459
Chris Kerr
Apr 10, 2024
I'd also like support for HSB and CIELAB color spaces
Sam - Tokens Studio
Apr 12, 2024
I've added to the post for you! 🌈
Xavier
Apr 15, 2024
Well, today I need another plugin to manage OKLCH color space... Would be great to have it in Token Studio to smooth everything.
Sam - Tokens Studio
Apr 18, 2024
@Marco Christian Krenn added for you! Is it right?
Chris Kerr
Apr 18, 2024
@Sam - Tokens Studio Can I please add OKLAB to the list too please?
Sam - Tokens Studio
Apr 25, 2024
Done!
Mike (Tokens Studio)
Jun 5, 2024
IMPORTANT FOR US — DTCG format update on color tokens and support for color spaces.
Hey everyone, for those who aren't aware, I'm supporting the DTCG as en editor for the spec. One of the topics we're currently finalizing is the updated proposal for colour in design tokens.
I'm posting a comment here to collect feedback on the current state of the proposal. Early responses are highly appreciated 🚀🚀
This thread holds the context: https://github.com/design-tokens/community-group/issues/137
And this is the proposed format:
{ "my-token": { "$type": "color", "$value": { "hex": "#xxxxxx", "colorSpace": "color-space", "channels": [0.1, 0.2, 0.3], "alpha": 0.5 } } }Color spaces supported:
srgb | srgb-linear | display-p3 | a98-rgb | prophoto-rgb | rec2020 | lab | oklab | xyz | xyz-d50 | xyz-d65 | hsl | hwb | lch | oklchNext steps (from DTCG team)
- Figure out aliasing. Possibly "hex": "{my-token.hex}", "channels": "{my-token.channels}", but this doesn’t feel very natural or particularly safe.
- 8 week-long RFC where we ask tool makers in particular for feedback.
Below a summary of the thread to get you up to speed if you don't have time to read the whole discussion:
Summary of Discussion on Legacy Color Issue (#137)
Overview:
The discussion revolves around the limitations of using hex color formats in design tokens, advocating for more modern and flexible color representations such as LAB, LCH, and OKLAB. Participants emphasize the need for future-proofing the design token specification to accommodate advanced color spaces already supported by some browsers and anticipated to become standard.
Key Points:
Modern Color Support:
- Proposal: Standardize on modern color formats (e.g., OKLCH) instead of hex.
- Justification: Modern color formats offer better perceptual uniformity and more accurate color representation.
Flexible Color Representation:
- Alternative Syntax:
"colorSpace": "sRGB","channels": [0.1, 0.1, 0.1],"alpha": 1.0Advantages: This format supports various color spaces and offers higher precision compared to hex values.
Backwards Compatibility and Toolchain Adoption:
- Concerns: Current toolchains predominantly support sRGB and hex formats.
- Suggestion: Include fallbacks to hex while allowing modern formats for future compatibility.
Practical Implementation:
- Fallbacks Example:
"colorSpace": "Display-P3","channels": [1, 0.5, 0],"alpha": 1,"fallback": "#FF8800"Tool Compatibility: Tools can adopt modern formats without immediate need for full support, ensuring smoother transitions.
Community Insights and Concerns:
- Wide Gamut Support: Limiting to hex/sRGB restricts the potential of design systems to leverage advanced color spaces.
- Precision and Accuracy: Higher precision formats like floating-point numbers prevent rounding errors common in hex conversions.
Consensus and Next Steps:
- Flexibility in Spec: Propose allowing both hex and advanced color formats to coexist in the specification.
- Future-Proofing: Emphasize the importance of a forward-compatible spec that adapts to evolving design tools and browser capabilities.
Conclusion:
The discussion highlights the need to move beyond legacy color formats and adopt a more flexible, future-proof approach in the design token specification, balancing current toolchain limitations with the advantages of modern color spaces.
Michael Gamble
Jan 9, 2025
Sorry i just saw this proposal after making my post higher up - amazing the proposal sounds like it would do exactly what I need.