Skip to content
ChartDeck ChartScript docs Account Open the terminal

palette

Named colour sets the member can pick and edit (input.palette, palette.get).

#Functions

#palette.getfunction

One colour of a palette by its key (na when the key is missing).

palette.get(palette: string, key: string): color
ParameterTypeDescription
palettestringA palette (palette.new or input.palette).
keystringThe colour's key.

Returns color.

Example

ChartScriptFragmentOpen in editor
const pro = palette.new("Pro", { bull: #26A69A, bear: #EF5350 })
const p = input.palette(pro, "Palette")
const c = palette.get(p, "bull")

Since ChartScript 1

#palette.newfunction

A named palette: the palette's name, then an options object of key: colour pairs ({ bull: #26A69A, bear: #EF5350 ... }).

palette.new(name: const string, colors: const color, …): string
ParameterTypeDescription
nameconst stringThe name shown to the member.
colorsconst colorkey: colour pairs in an options object ({ bull: #26A69A, bear: #EF5350 }).

Returns string.

Example

ChartScriptFragmentOpen in editor
const pro = palette.new("Pro", { bull: #26A69A, bear: #EF5350 })
const p = input.palette(pro, "Palette")

Since ChartScript 1

The ChartScript documentation is in English for now; translations will follow.