Color picker with only 1 slider

view full story

http://stackoverflow.com – I'm trying to create a color picker that uses only one slider. I know this won't allow for all colors and I won't be able to adjust alpha, hue and saturation. There are many examples of color pickers out there. One common color picker involves using a square and a linear spectrum. The square allowing you to change hue and saturation. I just want the linear spectrum values. I would love to do this with some algorithms but I can't think of how to start it. Worst case, I could use an array that has the colors and just use the progress bar's value as the index. (HowTos)