An abstract with various color utility functions.
Available since:
4.0.0
Class Fields
colorLerp (fromColor : Color, toColor : Color, t : Float = 1) : Color
Linear interpolation between two colors.
Parameters:
fromColor | First color. | |
toColor | Second color. | |
t | Interpolation value. Clamped to the range [0, 1]. return RGB component-interpolated color value. |
getColorHSV (h : Float, s : Float, v : Float) : Color
Creates a color value with the chosen HSV values.
Parameters:
h | The hue of the color (from 0 to 1). | |
s | The saturation of the color (from 0 to 1). | |
v | The value of the color (from 0 to 1). |
Returns:
The color Int.
getColorRGB (r : Int = 0, g : Int = 0, b : Int = 0) : Color
Creates a color value by combining the chosen RGB values.
Parameters:
R | The red value of the color, from 0 to 255. | |
G | The green value of the color, from 0 to 255. | |
B | The blue value of the color, from 0 to 255. |
Returns:
The color.
Instance Fields
read only a : UInt
read only alpha : Float
read only b : UInt
read only blue : Float
read only g : UInt
read only green : Float
read only r : UInt
read only red : Float
getSaturation () : Float
Finds the saturation factor of a color.
Returns:
The saturation value (from 0 to 1).
getValue () : Float
Finds the value factor of a color.
Returns:
The value value (from 0 to 1).
lerp (toColor : Color, t : Float = 1) : Color
Shortcut to lerp between this color and another.
Parameters:
toColor | Second color. | |
t | Interpolation value. Clamped to the range [0, 1]. |