-
Notifications
You must be signed in to change notification settings - Fork 38
Specify accent colors as MaterialColor constants #151
Conversation
Move the material color generation logic out to a separate helper tool to be able to specify the accent colors as MaterialColor constants and to get rid of the extra "fooMaterialColor" variables that were exposed by the library.
Thank you this is much cooler! |
I was kind of testing the waters here to see the reaction. 😄 I'd love to try to make use of even more compile-time constants if possible. Compile-time constants not only provide better performance but can be used as default arguments too, for example. Non-constants have an unfortunate snowball effect that any code referencing them cannot be constants either. |
@Feichtmeier Are any other colors, such as the flavor colors, using similar logic or are the values chosen by hand? |
@jpnurmi the flavor versions (if used at all) are just for the sake of being a complete ubuntu theme. They could be created in the same way ofc if you prefer! It is kind of a mish mash currently Edit: ehhh sorry for the weird answer. The flavor colors are generated colors by some online tool I used (forgotten which one) |
The colors generated by https://material.io/inline-tools/color/ look a bit different. It has something more sophisticated under the hood. What do you think about these?
|
Oh, and it dynamically calculates the shade of the primary value too - not assumed 500. For orange and bark, it's 600, whereas olive is 800. |
If this wouldn't change the shade500 colours and the contrast improves overall sounds good |
With these colors, the primary shade is not always 500. It depends on the brightness of the primary value. |
Ah! Okay sorry. Yes I meant if the primary colour doesn't change |
Ok, I'll take a closer look at the color tool algorithm. |
Move the material color generation logic out to a separate helper tool
to be able to specify the accent colors as MaterialColor constants and
to get rid of the extra "fooMaterialColor" variables that were exposed
by the library.