-
Notifications
You must be signed in to change notification settings - Fork 373
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
Refactor design tokens to use a proper color table #8322
Conversation
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
|
||
impl ColorToken { | ||
#[inline] | ||
pub fn new(hue: Hue, shade: Shade) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With enumn
(which we already depend on) I could easy add support for u16
input, but then we must deal with error management. For that, we could either:
- panic
- have an invalid state for
ColorToken
(e.g.shade = None
), which would return a random color when queried (so it flashes in the UI) and logs an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice to finally get this!
# Conflicts: # crates/viewer/re_ui/src/lib.rs
Related
What
This PR refactors the design token as follows:
design_tokens.json
are now loaded in a big table at startup.ColorToken
, which is basically an index into this table.design_token.rs
file is the de facto source of truth of semantic aliasing for colors.