Color

fun Color(rgbHexCode: Int, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1.0f)

Create a color using an sRGB color space.

Parameters

rgbHexCode

The hexadecimal representation in the sRGB space.

alpha

The alpha component of the sRGB space. Must be between 0.0 and 1.0.


fun Color(@FloatRange(from = 0.0, to = 1.0) red: Float, @FloatRange(from = 0.0, to = 1.0) green: Float, @FloatRange(from = 0.0, to = 1.0) blue: Float, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1.0f)

Create the color using an sRGB color space.

Parameters

red

The red component of the sRGB space. Must be between 0.0 and 1.0.

green

The green component of the sRGB space. Must be between 0.0 and 1.0.

blue

The blue component of the sRGB space. Must be between 0.0 and 1.0.

alpha

The alpha component of the sRGB space. Must be between 0.0 and 1.0.