HSBtoRGB

fun HSBtoRGB(hue: Float, saturation: Float, brightness: Float, alpha: Float = 1.0f): Int

Converts the components of a color, as specified by the HSB model, to an equivalent set of values for the default RGB model.

The saturation and brightness components should be floating-point values between zero and one (numbers in the range 0.0-1.0). The hue component can be any floating-point number. The floor of this number is subtracted from it to create a fraction between 0 and 1. This fractional number is then multiplied by 360 to produce the hue angle in the HSB color model.

The integer that is returned by HSBtoRGB encodes the value of a color in bits 0-23 of an integer value that is the same format used by the method getARGB(). This integer can be supplied as an argument to the toColor method that takes a single integer argument to create a PolyColor.

Return

the RGB value of the color with the indicated hue, saturation, and brightness.

Parameters

hue

the hue component of the color

saturation

the saturation of the color

brightness

the brightness of the color

alpha

(since 1.3) the alpha of the color