Skip to main content

Function: applySettings()

applySettings(app, settings): Promise<void>

Defined in: src/lib/settings/index.ts:184

Use app settings on a canvas, e.g. ones kept in the browser or imported. Parts left out stay as they are; invalid values within a part are left out (see each part's sanitising). Colour palettes, profile graphs and brush presets are added to the user's own, replacing those with the same IDs. Colours older versions saved in PaintCanvas's palette are moved to one of the user's own (see keepOlderPalette). Other parts go to the settings extensions (see SettingsExtensions.apply).

Parameters​

app​

default

settings​

AppSettings

Returns​

Promise<void>

Example​

await applySettings(canvas, { colours: { foreground: "#ff0000", background: "#ffffff" } });