

color_generator = () => an array of HSV colors (each HSV color
The technical reason is very boring, so I skip it but you can dig in wiki. Random color generator in JavaScript - Following is the syntax to.
So, I transformed the hue through acos function. It creates a very nice spectrum of bright and vivid colors but the problem is that in usual color spectrum red, green, blue shades are way more dominant than yellow, cyan, and purple.

If I had the reputation, I would have simply commented the jsbin link I created. I figured I'd post an additional answer to this already mega-sized Stack Overflow question because the top answer has another comment linking to a Gist with the JavaScript implementation of Ankerl's logic and that link is broken (404). The top voted comment of the top answer suggests that Martin Ankerl's approach is better than random hex numbers, and although I haven't improved on Ankerl's methodology, I have successfully translated it to JavaScript. If you wish to see what this looks like in action see Simple JavaScript Rainbow Color Generator for Google Map Markers. This is ideal for creating easily distinguishable vibrant markers in Google Maps and other apps. This function generates vibrant, "evenly spaced" colours (i.e. * step: The step number, means the order of the color * numOfSteps: Total number steps to get color, means total colors This is perfect for creating pop-out markers in Google Maps that have optimal "uniqueness" (that is, no two markers will have similar colors). To ensure the colors are distinct I avoid using a random generator and select "evenly spaced" colors from the rainbow. My goal was to create vibrant and distinct colors.
