Oklch

data class Oklch(val lightness: Double, val chroma: Double, val hue: Double, val alphaFraction: Double = 1.0) : Color

oklch(L C H) / oklch(L C H / α). Lightness is 0..1, chroma is unbounded non-negative (typical max ~0.4), hue is degrees. Out-of-gamut channels are clipped.

Constructors

Link copied to clipboard
constructor(lightness: Double, chroma: Double, hue: Double, alphaFraction: Double = 1.0)

Properties

Link copied to clipboard
open override val alpha: Int

Alpha channel, 0..255 (255 = opaque).

Link copied to clipboard
Link copied to clipboard
open override val blue: Int

Blue channel, 0..255.

Link copied to clipboard
Link copied to clipboard
open override val green: Int

Green channel, 0..255.

Link copied to clipboard
val hue: Double
Link copied to clipboard
Link copied to clipboard
open override val red: Int

Red channel, 0..255.

Functions

Link copied to clipboard
open fun toCssString(): String

Canonical CSS string form for this color (e.g. #ff8800, rgba(255, 0, 0, 0.5)).