Yes, you probably learned in primary school (oh, pun!) that "red, yellow and blue are THE PRIMARIES. Because we can mix all the others colors with just those!"
But, NOOOOOOOO, this is wrong!!!!!!!!! wrong!
It's almost close, though. The primary colors for pigments are Magenta, Yellow and Cyan. The primaries for light are Red, Blue and Green. And all of them combine to a full color wheel with 6 equal primaries. If you want to learn more about this: here (long) and here (short)
This Hue range is actually "in reverse". It just lined up better with the uneven note spaces.
It seems to be pretty standard to start the C with red. So I did this too.
I started with with just putting the primary colors on every named note. As a 7th color orange was the most logical choice. We have a very distinguished perception between yellow, orange and red. And since B is very close to C it also fits in a musical sense.
When it comes to E and F it does not work extremely well. Yes, both are "bluish" hues, but they have a very harsh difference in dark-to-light to our human vision.
As soon as the sharps and flats are added it works even less well: F#, G and G# are barely different for humans (fun fact: people with red-green blindness are better at distinguishing that range).
Moving cyan to F# has some benefits
However the downside is, that the primary color Cyan is no longer included in the basic notes.
The steps from E to G and A to C even work in the same way:
G# and F are not at the 50% position between their neighbors to increase readability.
Incidentally these color schemes line up with the traditional german Triola (they muted the colors a bit). And books like "Meine Bunten Noten".
Sadly, a lot of color schemes on instruments don't make that much sense...