rgb

fun rgb(r: Double, g: Double, b: Double, a: Double = 1.0): ColorRGBa(source)

Shorthand for calling ColorRGBa. Specify only one value to obtain a shade of gray.

Parameters

r

red in [0,1]

g

green in [0,1]

b

blue in [0,1]

a

alpha in [0,1], defaults to 1.0


fun rgb(gray: Double, a: Double = 1.0): ColorRGBa(source)

Shorthand for calling ColorRGBa.

Parameters

gray

shade of gray in [0,1]

a

alpha in [0,1], defaults to 1.0


Shorthand for calling ColorRGBa.fromHex. Creates a ColorRGBa with Linearity.SRGB from a hex string.

Parameters

hex

string encoded hex value, for example "ffc0cd"


fun rgb(red: Int, green: Int, blue: Int, alpha: Int = 255): ColorRGBa(source)

Converts RGB integer color values into a ColorRGBa object with sRGB linearity.

Parameters

red

The red component of the color, in the range 0-255.

green

The green component of the color, in the range 0-255.

blue

The blue component of the color, in the range 0-255.

alpha

The alpha (transparency) component of the color, in the range 0-255. Default value is 255 (fully opaque).