so I have set up a predefined list of colors in an array and I have almost got it working the way I like. Input ranges from 0 to 1. If input = .2 then the array of colors only has for example's sake 5 elements. If input =.9, then the array of colors gets bigger.
I don't want to do random generation of colors. I want to work with a predefined array.
My question is, how can I modify this code so that when input gets close to 1, saturation of the colors will reach the max value and when input is closer to 0 the saturation will get closer to its min value? And keep hue and brightness constant.