rgb

fun rgb(r: Int, g: Int, b: Int, a: Int = 255): ShapeColor

Builds a color from 0..255 channel values; a defaults to fully opaque.

Each channel is masked to its low 8 bits before packing, so an out-of-range value wraps rather than throws.

Return

The packed ShapeColor.

Parameters

r

The red channel, 0..255.

g

The green channel, 0..255.

b

The blue channel, 0..255.

a

The alpha channel, 0..255; 0xFF (opaque) by default.