Comments (11)
Aesthetic.get()
.colorPrimaryRes(R.color.md_indigo)
.colorPrimaryDarkRes(R.color.md_indigo_dark)
.colorAccentRes(R.color.md_yellow)
.apply();
from colorful.
#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
from colorful.
I know Colorful
all colors are through styles to get now, these colors can be used as the default color, But style can only meet few users, color can satisfy all users, So you can add a method like this, setPrimaryColor(hexColor: String
okay?
from colorful.
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.
from colorful.
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.
from colorful.
But if this application allows users to pass custom color codes, style does not solve the problem.:sob:
from colorful.
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.
from colorful.
Okay thank you.
from colorful.
@garretyoder Aesthetic
has many problems and it is costly to maintain, If Colorful
supports setting primary and accent colors programmatically, it will be perfect.
from colorful.
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.
from colorful.
I think you are right.
from colorful.
Related Issues (20)
- Not working after app restart HOT 4
- Load style resources by name not by id
- "setPrimaryColor" and "setCustomThemeOverride" conflict HOT 12
- Disabled override how to use light/dark theme HOT 1
- Request to add color HOT 3
- Use THEME_MATERIAL appear error log HOT 10
- Colorful has error when start strict mode HOT 7
- Some times primaryColor and accentColor are not used HOT 9
- Sample code for use without kotlin HOT 5
- Compile issue error: style attribute 'attr/colorSecondary HOT 11
- Does Proguard settings mentioned in document?
- Material Drawer Theming Support? HOT 3
- Migrate to AndroidX HOT 1
- How to customize views in theme?
- ThemeEditor public apply method needs null check
- startSupportActionMode works not propertly with Colorful
- ERROR: Failed to resolve: com.github.garretyoder:Colorful:2.3.4 HOT 1
- R styles not found on API 19 HOT 1
- App bar and Statusbar need same color HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colorful.