I’m trying to build a colors structure that has 3 data per item. For example, red has x and y, blue has x and y, etc. So the 3 pieces of data are color, x, y
What structure do I need to make it easy to read the x and y based on the color. I usually do push(color, x, y) but that wouldn’t work here, because I need to search quickly by the color without needing to loop. What structure do I need here, and how do I set it and get it.
or if you have structure like this
then
or
then