rgbToHSV problems

I have been trying to convert RGB values to HSV but I haven't managed to accomplish this still.

This produces a error

hsvColors = ColorUtils.rgbToHSV( [r,g,b] )

GroovyCastException: Cannot cast object '255' with class 'java.lang.String' to class 'int'

But if I hard code the SAME rgb values it works.
hsvColors = ColorUtils.rgbToHSV( [255,255,251] )

HSV : [16.67, 1.57, 100.0]

Why is this a issue ??

You're passing in string values...

2 Likes

DOH !!!!! again the details....... good grief.

1 Like

Doh!, and I wrote (copied really) a set of these :man_facepalming:

?? what do you mean ??