Color
An RGBA color with 8 bits per channel, packed as 0xRRGGBBAA.
Samples
val orange = Color(red = 1f, green = 0.5f, blue = 0f)
assertPrints(orange, "Color(#ff8000ff)")
assertPrints(orange.red, "1.0")
assertPrints(orange.alpha, "1.0")
assertPrints(Color.WHITE, "Color(#ffffffff)")
assertFailsWith<IllegalArgumentException> { Color(red = 2f, green = 0f, blue = 0f) }Content copied to clipboard
Types
Link copied to clipboard
object Companion
Holds shared color constants. Every one but TRANSPARENT is opaque, with each channel either full or zero, except GRAY, whose channels are all 0x80.