-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to Radix color table and "2D color coordinates" #3133
Comments
Thanks for taking notes!
I think it might be worth having this live in the tokens file for 3 reasons:
Based on this, I suggest this JSON format: {
// We add radix colors and other global tokens here
"colors": {
"slate": {
"1": {
"$type": "color",
"$description": "",
"$value": {
"hex": "#000000"
}
},
"2": {
"$type": "color",
"$description": "",
"$value": {
"hex": "#000000"
}
},
"3": {
"$type": "color",
"$description": "",
"$value": {
"hex": "#000000"
}
}
}
},
// This is where we add our custom values
"surface": {
"default": {
"$type": "color",
"$description": "Default color in...",
"$value": "{color.slate.2}"
}
},
"interactive": {
"default": {
"$type": "color",
"$description": "Default color in...",
"$value": "{color.slate.4}"
},
"hover": {
"$type": "color",
"$description": "Default color in...",
"$value": "{color.slate.5}"
},
"pressed": {
"$type": "color",
"$description": "Default color in...",
"$value": "{color.slate.3}"
}
}
} |
Related reading:
|
In case you hadn't noticed, I published an egui toolkit based on the Radix system and APCA luminosity contrast and without .json files. Its purpose is to give food for thought about colour styling. |
### Related * Part of/related to #3133 * Part of #3058 ### What This PR refactors the design token as follows: - All colors from `design_tokens.json` are now loaded in a big table at startup. - Colors are now referred to using the new the `ColorToken`, which is basically an index into this table. - Removed all of the color aliases stuff. This was only partially used and very cumbersome to update. The `design_token.rs` file is the _de facto_ source of truth of semantic aliasing for colors.
These are some notes following a discussion with @martenbjork on how to evolve the current design token system in the short term, such as to address some of its shortcoming and go in the direction of emilk/egui#3284.
Goals
Solutions
The idea is to minimise friction when new alias must be created by rerun dev (use-case example: subdued container color in the blueprint tree UI, etc.) during dev iterations. Using a file on rerun-io/landing is not possible since that repo is private (can't easy pull the json where it's needed).
design-token.json
file. Create/update script to automate pulling the file from the reference repo.The text was updated successfully, but these errors were encountered: