So I have a hard problem... Or I think I do... 🥲
I am trying to generate colors for each questions for the Stats graph.
It turns out, the solution I wanted to go with is to hash the questionID, like : BFS, or DFS etc... and then generate a color based on it.
But I am getting collisions (as expected)
Acceptance criteria
The colors should be disctincts for the human eye
The color should be automatically generated (I don't want to select the color manually as the number of questions could grow...)
Example of collisions
notice how Merge Int., bfs it., 'Factorial`, ... have collisions when I hash the questionId to a 16 bits integer.
Here are collisions on a 32 bit integer hashed number binary search and Insert int. ...
Debuging infos
To confirm those are color collisions I checked what's the hue produced for 2 questionIds resulting in similar colors. Those really are collisions for the human eye. Notice the 4 points gap between bother hues
Here is the eye collision seen for Topological sort and Meeting rooms
Description
So I have a hard problem... Or I think I do... 🥲 I am trying to generate colors for each questions for the Stats graph. It turns out, the solution I wanted to go with is to hash the questionID, like : BFS, or DFS etc... and then generate a color based on it. But I am getting collisions (as expected)
Acceptance criteria
for the human eye
Example of collisions
notice how
Merge Int.
,bfs it.
, 'Factorial`, ... have collisions when I hash the questionId to a 16 bits integer.Here are collisions on a 32 bit integer hashed number
binary search
andInsert int.
...Debuging infos
To confirm those are color collisions I checked what's the hue produced for 2 questionIds resulting in similar colors. Those really are collisions for the human eye. Notice the 4 points gap between bother hues
Here is the eye collision seen for
Topological sort
andMeeting rooms