Need help generating random colors by HSV (not RGB)
Hello guys ,
I'm not sure if what I want is even possible, but here goes! The script below generates random fore and-backgroundcolors based on RGB. Instead, I want to generate colors by HSV.
So this...
#target photoshop
var Colour = new SolidColor;
Colour.rgb.red = Math.ceil(255*Math.random());
Colour.rgb.green = Math.ceil(255*Math.random());
Colour.rgb.blue = Math.ceil(255*Math.random());
app.foregroundColor = Colour;
Colour.rgb.red = Math.ceil(255*Math.random());
Colour.rgb.green = Math.ceil(255*Math.random());
Colour.rgb.blue = Math.ceil(255*Math.random());
app.backgroundColor = Colour;
...would look like something like this :
#target photoshop
var Colour = new SolidColor;
Colour.hsv.hue = Math.ceil(360*Math.random());
Colour.hsv.saturation = Math.ceil(100*Math.random());
Colour.hsv.value = Math.ceil(100*Math.random());
app.foregroundColor = Colour;
Colour.hsv.hue = Math.ceil(360*Math.random());
Colour.hsv.saturation = Math.ceil(100*Math.random());
Colour.hsv.value = Math.ceil(100*Math.random());
app.backgroundColor = Colour;
Even better would be if I could select a range in the hue slider. So I can isolate a specific color.
Any help is greately appreciated!
