2021.7 History graph color changes

Shameless plug: history explorer card :stuck_out_tongue: Solves the visibility problem, makes the history colors themeable and much more.

What do you suggest they should do ? Currently they use a fixed pool of predefined colors they sequentially assign to states as they come along. This is a reasonable way to do it. It will guarantee that same states across different entities will receive the same color and it will reduce the risk of collision between two similar colors. It will however not guarantee continuity. If the order of entities or states displayed in entities change, then the color assignments for a certain state will change.

Thereā€™s not 100 million ways of doing this. You canā€™t know the states youā€™re going to encounter and you donā€™t know in which entities theyā€™re going to show up. You donā€™t know which of the states (that you donā€™t know) are going to end up side by side in which entity. The code isnā€™t psychic, it canā€™t read your mind.

In my history explorer card I linked to above I used a different approach. I used MD5 hashes of entity state names to generate colors for them. This solves the continuity problem (a certain state will always retain the same color regardless of order), but it can generate similar colors on a same entity timeline for adjacent states. Thereā€™s always advantages and drawbacks, thereā€™s no perfect system for automatically determining colors.

Or just assign manual colors to the states you care most about.

1 Like

I havenā€™t used this (yet) but that video makes it look ridiculously good.

That should be built into core. Also, if you want more hits, you should look into getting that into HACS. Very nice card.

Thanks, I actually did apply for HACS inclusion a while ago, but last I checked there were over 20 applications waiting to be reviewed. I guess Ludeeus is still working on the backlog that built up over the holidays. Gotta be patient :slight_smile: