-
Notifications
You must be signed in to change notification settings - Fork 194
Use custom color #30
Comments
#FFFFFF is already in the library, that's ThemeColor.WHITE. Support for what you're imagining (setPrimaryColor(hexColor: String) will never come because of the way colorful is built. Colorful uses Android's native style engine, which uses styles. Styles are a immutable object that cannot be created or modified at runtime. However, a future planned feature is to allow users to define additional colors via user-provided style files. See issue #23 |
I know |
Reread what I said above please. Setting a arbitrary hex color will never happen because of how Android's styles work. However, being able to define additional styles that have custom colors will come soon. |
|
This library is archetected completely differently than colorful. Asthetic is the successor to ATE, a library I used to do work on. Asthetic overrides the view inflator and manually styles views. Colorful merges styles together and let's Android do it. Both approaches have their merits, Asthetic can be more flexible but is incredibly complex and has a high overhead. Colorful is a bit more restricted but is light and fast. As I said, this feature will come soon, just in a different format. You will be able to define your own style file that contains whatever color you want and have colorful merge it. |
But if this application allows users to pass custom color codes, style does not solve the problem.:sob: |
If you want to provide the user with a hex color picker for theme color, then I'd recommend you use a library like Asthetic and deal with the overhead. If you just want to add additional colors to colorful's pallet, that will come soon. This is simply a limitation of the Android platform. I've been asking for mutable style objects for a long time. |
Okay thank you. |
@garretyoder |
As I said, due to the fact that Colorful uses Android's native style engine, this is impossible and will not happen until such a time when Google allows mutable style objects. I'd advise you to take a step back and ask do you really need to present your users with a hex color picker? I've found that most are more than happy with the material color pallet, which is why I wrote colorful. |
I think you are right. |
How to set custom color codes for Accent and Primary colors, such as
#FFFFFF
?If not support now, can you add a method to set the color code for Primary and Accent? This is useful, thanks.
The text was updated successfully, but these errors were encountered: