Open KTibow opened 3 years ago
Hi @KTibow !
Yes. This is very easy to add to core. Right now, I need to hack my way into the component and replace the inner function there that generates the colors.
If I'm adding this to the home assistant core, changing the color will be very fast.
It's just... Will the core team be interested? I guess they chose those colors. No? Do you think the community would prefer my lighter colors?
Thanks!
Try asking on the discord, I'm not on there but I hear there's some good folks there. The main thing is accessibility, you need to be able to differentiate all of the different colors, and the colors from the background colors.
I believe they got it from Google Graphs, but I do like yours better.
I'm working on open a pull request soon to home-assistant/frontend
Is it done yet? Can you give me a link?
Are you okay if I do this for you?
Do you think the community would prefer my lighter colors?
I can only speak for myself: I personally like the original colors better. These colors look to pale for my taste. But I'd say that highly depends on the theme you are using. Sidenote: The white text on the lighter colors is not as readable as with the original colors.
Maybe the existing and new colors can be averaged?
That could be a solution. Something like CSS vars aren't usable here, right? That would be the best solution - to make the graphs themable.
That's super easy actually! Just change the hex codes to variables with the hex codes as fallbacks.
Even better! Then the best solution would be theme vars + an average of the old and new colors as default. As an alternative theme vars + the old colors as fallback, which might get accepted more likely, because it doesn't change anything.
I could imagine theme vars like graph-color-00
, graph-color-01
etc
Sounds good! You can make the PR. In my opinion it should be something like graph-color-red-01
, graph-color-green-02
, etc. for the theming. Also try posting this on the HA forums with a poll, and see what the community thinks.
Don't you think that would generate some weird names because there are so many different colors? As for instance I picked one color from the list and searched the name: graph-color-faux-caribbean-green-01
Also if I want to change the colors completely in my theme, something like that triggers my OCD 😜 graph-color-red-01: green
That's why I'd rather use generic names and let the user deside what color he/she wants to use.
I can make the PR, but not unil next week or the week after next (setting everything up in a dev instance, testing and creating the PR takes a lot of time for me as a relative beginner - but my time is very limited at the moment)
I can do it then. Here I go!
Nice @KTibow ! beat me to the punch :-)
Status?
https://www.home-assistant.io/blog/2022/12/07/release-202212/#shiny-new-state-colors
So... this frontend integration is useless starting HA Core 2022.12 anyway?
I suspect the state colors would be new if you have 2022.12, but this integration would override them with its own. But it might not.
Well, it isn't working anymore anyway (still on HA Core 2022.11). https://github.com/Kibibit/kb-better-graph-colors/issues/9
Sounds like time to say goodbye to this integration. Unfortunately.
Any possibilities of adding this to the original frontend repository? Do you already have a PR pending?