DarkVariant

Type module

Sources

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

/**
 * --------------------------------------------------------
 * Import via: DarkVariant.ts
 * Access items like: $darkvariant.myVariable
 *                    $darkvariant.myFunction()
 * --------------------------------------------------------
 */
import * as $darkvariant from "@amcharts/amcharts5/DarkVariant";

Variables

secondary
#

Type Color

Default Color.fromHex(0x2b2b2b)

primary
#

Type Color

Default Color.fromHex(0x5a7fa8)

l
#

Type lighten

Default Color.lighten

Shared building blocks for the "… Dark" variants of the palette themes (Dataviz, Kelly, Material, Moonrise, Spirited, Frozen).

A dark variant reuses its light counterpart's series palette and only swaps in a dark set of interface colors — except that any palette entry too dark to be seen on the dark ground is lifted perceptually (in OKLCH) so it stays visible while keeping its hue. Colors already bright enough are left untouched.

Functions

darkInterfaceColors()

#

Returns Partial

A neutral dark set of interface colors, shared by every dark palette variant so they differ only by their series palette.

liftDarkColors(

colors: Array,
minL: number

)

#

Returns Array

Raises the lightness of any color darker than minL (OKLCH lightness, 0..1) up to minL, holding hue and chroma, so it reads on a dark ground. Colors at or above minL are returned unchanged.