{
"seeds": {
"primary": "#4f46e5",
"secondary": "#7c3aed",
"neutral": "#334155"
}
} These are the colours in the panel above.
Cortex turns your brand colours into every design token a product needs, as plain CSS variables. No framework, no runtime.
npm install @flexpixels/cortex@beta Your three colours
What Cortex generates from them
Seven colour roles, twelve steps each. Success, warning, danger and info are derived unless you set them. The surfaces are the page, a recessed band, a raised card, a menu, and a tooltip in the other scheme’s colours.
Rendered with those tokens
Three tasks left before Friday.
PublishView tasksName three colours. One function returns the stylesheet as a string, in Node, in Bun or in the browser.
{
"seeds": {
"primary": "#4f46e5",
"secondary": "#7c3aed",
"neutral": "#334155"
}
} These are the colours in the panel above.
import { generateThemeCSS, loadUserConfig } from "@flexpixels/cortex"; const css = generateThemeCSS(loadUserConfig());
Write the string to a file in a build script, or run it in CI.
Everything below is measured from the stylesheet this page is wearing.
That is every colour ramp, and the type, spacing, radius, elevation and motion tokens a page uses; output.tokens: "full" writes every token. The bars are drawn to scale.
Use them from any stylesheet, in any framework, or in none.
.button {
background: var(--fp-primary-9);
color: var(--fp-primary-9-contrast);
} Each text colour is chosen against the surface it sits on, to WCAG AA, before the file is written.
One set of variables. The browser picks the scheme, so there is nothing to switch in JavaScript.
The same engine as an MCP server. An agent can make a theme, check it and export it, and gets measured answers back.
@flexpixels/cortex-mcp