Skip to content

OKLCH

Type module

Sources

Items from OKLCH can be imported/included and used via following ways.

/**
* Import via: OKLCH.ts
* Access items like: $oklch.myVariable
*/
import * as $oklch from "@amcharts/amcharts5/OKLCH";

Variables

OKLCH does not have any variables.

Functions

cbrt(x: number)

Returns number

clamp01(x: number)

Returns number

colorToOKLCH(color: Color)

Returns IOKLCH

Converts a Color to its OKLCH components.

inGamut(lin: ...)

Returns boolean

lchToLinear(l: number,
c: number,
h: number
)

Returns ...

linearToOklab(r: number,
g: number,
b: number
)

Returns ...

oklabToLinear(L: number,
A: number,
B: number
)

Returns ...

oklchToColor(l: number,
c: number,
h: number,
clamp: boolean
)

Returns Color

Converts OKLCH components to a Color. By default, a color outside the sRGB range is brought into it by reducing its chroma, keeping lightness and hue.

toGamma(c: number)

Returns number

toLinear(c: number)

Returns number