@mocanvas/editor · function

createTheme

declare function createTheme(id: TLThemeId, patch?: TLThemePatch): TLTheme

A theme built on top of the built-in one — the way an app feeds its own design tokens to the canvas:

``ts const brand = createTheme("default", { colors: { light: { blue: { ...DEFAULT_THEME.colors.light.blue, solid: tokens.brandBlue } } }, }) ``

Starting from DEFAULT_THEME rather than from nothing is what keeps every colour name defined — see registerColorsFromThemes for why dropping one is a data-loss bug rather than a missing swatch.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.