Hct

class Hct

A color system built using CAM16 hue and chroma, and L* from Lab*.

Using L* creates a link between the color system, contrast, and thus accessibility. Contrast ratio depends on relative luminance, or Y in the XYZ color space. L*, or perceptual luminance can be calculated from Y.

Unlike Y, L* is linear to human perception, allowing trivial creation of accurate color tones.

Unlike contrast ratio, measuring contrast in L* is linear, and simple to calculate. A difference of 40 in HCT tone guarantees a contrast ratio >= 3.0, and a difference of 50 guarantees a contrast ratio >= 4.5.

HCT, hue, chroma, and tone. A color system that provides a perceptually accurate color measurement system that can also accurately render what colors will appear as in different lighting environments.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val hue: Double
Link copied to clipboard

Functions

Link copied to clipboard

Translate a color into different ViewingConditions.

Link copied to clipboard
fun toInt(): Int
Link copied to clipboard
fun withChroma(newChroma: Double): Hct

Set the chroma of this color. Chroma may decrease because chroma has a different maximum for any given hue and tone.

Link copied to clipboard
fun withHue(newHue: Double): Hct

Set the hue of this color. Chroma may decrease because chroma has a different maximum for any given hue and tone.

Link copied to clipboard
fun withTone(newTone: Double): Hct

Set the tone of this color. Chroma may decrease because chroma has a different maximum for any given hue and tone.