RGBtoHSB

fun RGBtoHSB(r: Int, g: Int, b: Int, out: FloatArray? = null): FloatArray

Converts the components of a color, as specified by the default RGB model, to an equivalent set of values for hue, saturation, and brightness that are the three components of the HSB model.

If the out argument is null, then a new array is allocated to return the result. Otherwise, the method returns the array out, with the values put into that array.

Return

an array of three elements containing the hue, saturation, and brightness (in that order), of the color with the indicated red, green, and blue components.

Since

0.18.2

Parameters

r

the red component of the color

g

the green component of the color

b

the blue component of the color

out

the array used to return the three HSB values, or null

See also