For the complete documentation index, see llms.txt. This page is also available as Markdown.

Palette

Core palette generation — compute palettes, color systems, harmonies, dominant colors, and export to various code formats.

Generate a color palette

post

Generate a complete color palette from base and theme configurations. Returns the full PaletteData object produced by the palette engine.

Body
includeLibraryDatabooleanOptional

Include internal library metadata in the response.

Default: false
compactbooleanOptional

Return a compact (lighter) representation of the palette.

Default: false
Responses
200

Palette data

application/json
objectOptional

Full PaletteData object. Shape depends on the palette engine version and compact flag.

post
/get-palette

Build a semantic color system

post

Resolves taxonomy bindings against a generated palette to produce a semantic SystemData object. Requires @a_ng_d/utils-ui-color-palette >= 1.10.0 on the worker.

Body
Responses
200

System data

application/json
objectOptional

SystemData object produced by the palette engine.

post
/get-color-system

Generate color harmonies

post

Compute one or all color harmonies (complementary, analogous, triadic, etc.) from a base color.

Body
analogousSpreadnumberOptional

Spread angle (in degrees) used for analogous harmonies.

Example: 30
returnFormatstring · enumOptional

Output format for each color in the result.

Default: bothPossible values:
typeone ofOptional

Harmony to compute. Use ALL (default) to get every harmony at once.

Default: ALL
string · enumOptionalExample: COMPLEMENTARYPossible values:
Responses
200

Harmony result

application/json
or
post
/create-color-harmony

Extract dominant colors from an image

post

Extract the most prominent colors from a JPEG or PNG image. The image can be supplied in three ways:

  1. Multipart uploadContent-Type: multipart/form-data with an image file field.

  2. URL — JSON body with imageUrl. 3. Raw pixel data — JSON body with imageData { data: number[], width, height }.

Body
imagestring · binaryRequired

JPEG or PNG image file.

colorCountintegerOptional

Number of dominant colors to extract.

Example: 5
maxIterationsintegerOptional

Maximum k-means iterations.

tolerancenumberOptional

Convergence tolerance.

skipTransparentstring · enumOptional

Skip fully transparent pixels.

Possible values:
Responses
200

List of dominant colors

application/json
hexstringOptionalExample: #3B82F6Pattern: ^#[0-9a-fA-F]{3,8}$
populationnumberOptional

Relative frequency of this color in the image (0–1).

post
/extract-dominant-colors

Generate design tokens / code

post

Generate platform-specific design tokens or code from a palette. Accepts base + themes (not a pre-built paletteData object). Optionally pass a system to include semantic tokens.

Body
formatstring · enumOptionalExample: cssPossible values:
colorSpacestring · enumOptionalExample: RGBPossible values:
Responses
200

Generated code as a string or structured object depending on the format.

application/json
stringOptional

For text-based formats (css, scss, less, swift-ui, etc.)

or
post
/generate-code

Preview palette as SVG

get

Render a palette as an SVG swatch grid. The data query parameter uses a compact encoding: <theme>~<color>~<shade>:<hex6>[,<shade>:<hex6>][;<color>~...][|<theme>~...]

  • | separates themes - ; separates colors within a theme - ~ separates the name from shade pairs - , separates individual shade:hex pairs - : separates a shade name from its 6-digit hex value (without #) Values must be URL-encoded when they contain special characters.

Query parameters
datastringRequired

Compact palette data string.

Example: Light~Blue~50:EFF6FF,500:3B82F6,900:1E3A8A
Responses
200

SVG swatch grid

image/svg+xml
Responsestring · binary
get
/preview

Last updated