pro-visu docs
Generators

palette

A still colour-palette image with labelled, auto-contrasting swatches.

palette renders a still image of colour swatches, each labelled with the fields you place in its corners (name / hex / rgb / oklch / hsl / cmyk) with auto-contrasting text. Only colors is required. No url. Output is png.

{
  name: "brand-colors",
  generator: "palette",
  options: {
    colors: [
      { name: "Ink", hex: "#1a1714" },
      { name: "Camel", hex: "#b49a77" },
      { name: "Paper", hex: "#f6f3ed" },
    ],
    layout: "columns",
    uppercase: true,
  },
}

Options

OptionTypeDefaultMeaning
colors{ name, hex }[]Required. The colours to show (≥1). hex accepts #rgb or #rrggbb.
layout"rows" | "columns" | "grid""rows"Full-width bands, full-height columns, or an N-wide grid.
gridColumnsnumber (1–12)3Columns when layout: "grid".
width / heightnumber1400 / 1750Output size (default is portrait 4:5).
deviceScaleFactornumber (≤4)2Render scale.
backgroundstring"#ffffff"Page background, shown only in the gaps.
gapnumber0Gap between swatches (px).
cornerRadiusnumber0Swatch corner radius (px).
topLeft / topRight / bottomLeft / bottomRightFieldId[]TL ["name","hex"], TR ["rgb","oklch"]Fields shown (stacked) in each corner.
uppercasebooleanfalseUppercase the colour names.
rgbStyle"labeled" | "css" | "plain""labeled"RGB string style.
oklchStyle"css" | "labeled""css"OKLCH string style.
fontFilestringsystem sans fallbackCustom font (.woff2 / .woff / .ttf / .otf) embedded into the render. Optional — omit to fall back to a system bold sans.
fontSizenumberderivedLabel font size in px.
fontWeightnumber (1–1000)700Label font weight.
textLight / textDarkstring#ffffff / #141414Text colours picked by contrast against each swatch.
contrastThresholdnumber (0–1)0.5Luminance above which dark text is used.
paddingnumberderivedInset of labels from swatch edges (px).
fileNamestring<name>.pngOutput filename.

The available corner field ids are name, hex, rgb, oklch, hsl, and cmyk.

Place specific fields in each corner (each corner stacks its list top→bottom), and pick a layout:

{
  name: "brand-colors",
  generator: "palette",
  options: {
    colors: [
      { name: "Ink", hex: "#1a1714" },
      { name: "Camel", hex: "#b49a77" },
      { name: "Paper", hex: "#f6f3ed" },
      { name: "Loden", hex: "#5c5e4c" },
    ],
    layout: "grid",
    gridColumns: 2,
    topLeft: ["name"],
    topRight: ["hex"],
    bottomLeft: ["rgb"],
    bottomRight: ["oklch"],
    rgbStyle: "css",                     // rgb(26, 23, 20)
    fontFile: "public/fonts/Inter.woff2", // optional — embeds your brand font
    uppercase: true,
  },
}

Field formats

How each field renders:

FieldStyleExample
hex#FF8000 (always uppercased)
rgb"labeled"R:255,G:128,B:0
rgb"css"rgb(255, 128, 0)
rgb"plain"255 128 0
oklch"css"oklch(88% 0.012 250)
oklch"labeled"L:88% C:0.012 H:250
hslH:210,S:14,L:88 (s/l are percentages)
cmykC:0,M:50,Y:100,K:0 (percentages)

For a moving version, see palette-reel.

On this page