It's rainbow if we skip coloring 1 and 5 and color them with grayscale instead.
Here's the question. If we can allow one color not to be "colorful" (chromatic), what pitch would that be? It's the tonic (pitch 1).
If we allow two such colors? 5 is a good candidate, it's present in almost all popular scales. (Locrian isn't very popular.)
The rest 10 colors go in rainbow by thirds, as you proposed.
So, using two grayscale colors, I've reduced the demand to make distinct enough color palette from 12 colors to 10 chromatic + 2 grayscale.
Which (10), in my experience fighting with different screens and projectors, is almost the limit of having something stable, distinguishable, nameable and memorable.
As now, there's no relationship between colors beyond different notes, different colors
Perhaps choosing similar colors by distance on the circle of fifths or similar