ColorToken

data class ColorToken(val argb: Long)

A platform-neutral ARGB color value. UI adapters decide how it is rendered.

Constructors

Link copied to clipboard
constructor(argb: Long)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The alpha channel, 0..255.

Link copied to clipboard
val argb: Long
Link copied to clipboard

The blue channel, 0..255.

Link copied to clipboard

The green channel, 0..255.

Link copied to clipboard

The red channel, 0..255.

Functions

Link copied to clipboard

WCAG 2.x contrast ratio between this token and other, from 1.0 (identical) to 21.0 (black on white). The result does not depend on argument order. Compare it with MIN_TEXT_CONTRAST or MIN_NON_TEXT_CONTRAST when validating a re-branded theme.

Link copied to clipboard

WCAG 2.x relative luminance in 0.0..1.0, computed from the sRGB channels. Alpha is ignored, so translucent tokens are measured as if they were opaque.