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.