Skip to content

charton API


charton API / @chart-on/core / index / presetTheme

Function: presetTheme() ​

presetTheme(preset, mode, base?): ChartTheme

Defined in: packages/core/src/color-presets.ts:79

The chart theme of preset in mode: base (default the built-in light or dark theme for mode) with surfaces, lines, text, labels, watermark and heatmap mixed from the background, and line series and drawings in the primary colour, then the preset's own overrides. Up, down, bid, ask, alerts and level colours stay base's, so a colour-safe up and down pair in base survives. Text reaches 7:1 and muted text 5:1 (5.5:1 on dark presets) against the background. Headless use: chart.applyOptions({ theme: presetTheme(preset, 'dark') }).

Parameters ​

preset ​

ColorPreset

mode ​

"dark" | "light"

base? ​

ChartTheme

Returns ​

ChartTheme