LinearColor
An RGB color (linear or sRGB depending on the consuming API). Distinct from the spatial vectors so a LinearColor can't be passed as a Position. Components are r/g/b.
Deliberately not called Color: androidx.compose.ui.graphics.Color is in scope in practically every file that uses this library, and two same-named colour types with different transfer functions is a trap.
Interop with Compose UI colours goes through fromComposeColor / toComposeColor, which apply the sRGB transfer function in each direction — Compose colours are gamma-encoded, so copying their components across raw would wash the result out. Alpha is dropped; scene colours are RGB.
val tint = LinearColor.fromComposeColor(MaterialTheme.colorScheme.primary)Content copied to clipboard