Skip to content

@jsvision/core / aliasesFromSeeds

Function: aliasesFromSeeds()

aliasesFromSeeds(options): ThemeColors

Defined in: color/create-theme.ts:69

Derive the 16 semantic ThemeColors aliases from a set of seeds — the step createTheme runs before it merges overrides and expands the roles.

Give it the same mode/accent/neutral/status seeds you would pass to createTheme and it returns the resolved alias palette: a perceptual neutral ramp yields the surfaces and text, the accent yields the focus/selection colors, and the status seeds fill the rest. Any overrides or roleOverrides on the options are ignored here — this is purely the seed→alias derivation, exposed so a tool (e.g. a theme editor) can show the aliases a given seed set produces without building the full theme.

Parameters

options

ThemeOptions

Seeds (mode, accent, optional neutral/status). overrides/roleOverrides are ignored.

Returns

ThemeColors

The 16 resolved aliases, before any override merge.

Throws

InvalidColorError when a seed is 'default' or otherwise unresolvable.

Example

ts
import { aliasesFromSeeds } from '@jsvision/core';

const aliases = aliasesFromSeeds({ mode: 'dark', accent: '#3b82f6' });
aliases.accent; // '#3b82f6' — the seed, surfaced as the accent alias