-
Notifications
You must be signed in to change notification settings - Fork 543
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
Color Palette #116
Comments
|
Another point: do we want to add api such as color.darker() color.lighter() ? |
You already have impl InterpolatedPropertyValue for Color for animating colors. If you could expose that as With that function in place, you could drastically reduce the number of colors in the Palette and calculate the rest of them, making the theming easier for the end-users. |
I think that's a very good idea. The CSS color-mix() function takes that a step further by adding a color space parameter. API wise that might be even better for future support for different color spaces. What do you think? |
Although more color spaces give more flexibility to a designer, personally I would not miss them. If this At the moment the HSL space used for |
Coming from #1315 I'm wondering if the palette should perhaps be a model instead of a struct, and the rows are roles. If the palette was a struct and we'd have a per-widget palette, then that's a substantial amount of bytes spent for each widget when in most cases it would be copied from the global palette. If the palette were a model, then it would be basically a smart pointer that defaults pointing to the global palette but can be overridden by the user. |
Yes! And switching themes (dark mode - light mode - accessible mode) could also be implemented by just replacing the global palette. And as I mentioned, in many color schemes, intermediate tones are used by mixing base colors together. That could be done either on the palette by defining role colors mixed from base colors, or on the widget itself. |
Having the palette being of type But another possibility would be to just have special compiler support for this. So not every element would have a palette at runtime. in the implementation widget, one would simply do
And when using it we can override some of the palette with
Where palette is a builtin property. |
Ahh, interesting idea - this combines after all. We could use a model in the implementation but hide it behind the syntax you're proposing. Let me see if I understood correctly:
|
Where is this "button-background" defined? What happens when I mistype that as "butn-background" somewhere? Is that recognized as an error or will that silently add a new color to the palette? |
It would be defined in the compiler and typo would be detected |
Might we get an additional choice as an interim solution? A grey color scheme with high contrast text and widget outlines would be sufficient until custom colors are implemented. |
MVP merged in #3984 |
The idea would be to have a
Palette
singleton in the style, similar to theStyleMetrics
one.The palette would have property for each interresting color.
Idea for picking the different color roles:
The text was updated successfully, but these errors were encountered: