The hue changes in the x direction. The value (lightness) changes in the y direction. In every spot I chose the color with the largest possible saturation.
The top one is all my work. The bottom on comes from a third party library.
I like my work but I think it still has room for improvement. The primary colors are all thin lines, especially the blue. Things turn cyan or magenta so quickly, and those secondary colors are way overrepresented.
The 9 circles above show a closely related idea. This time I picked the colors by hand. They are all full intensity colors. I included all three primary colors and all three secondary colors. I also included 3 of the 6 tertiary colors: orange, azure, and violet. I left out rose because it looked too much like red. I left out chartreuse and spring green because they are almost identical to lime.
Update: I tweaked these slightly to make the apparent brightness more consistent. And I added more testing. The next image is identical except that I replaced the black background with a white one.
Below you can see all 12 primary, secondary, and tertiary colors in their brightest form:
Can you see this?