Docs Navigation (Stage 03)›

Custom Brand Palette

Maps custom design-system hex colors onto the mesh with edge-contrast optimization.

Key Takeaways

  • Use when clusters must match an organization's exact design-system hex tokens or categorical chart palette.
  • Still optimizes vertex assignment for edge contrast and blends bridge items in perceptual OKLab space.

Visual Mechanism

1. Design-System Hex Swatches#0891B2#D97706#C026D3#059669edge-contrast2. Mesh Assignment + OKLab Bridge Mix
Maps design-system hex swatches onto the simplex mesh using edge-contrast graph coloring while mixing bridge items in perceptual OKLab space.

Factory Signature

Re-exported from @simplex-viz/core, @simplex-viz/svg, and @simplex-viz/reactStage 03 Overview →
createPaletteColorStrategy<TItem, TTagMeta>(paletteHex: readonly string[], options?: PaletteColorOptions): SimplexColorStrategy<TItem, TTagMeta>

Options & Defaults

paletteHexDefault: required (≥ 1 hex)

readonly string[]

Array of CSS hex colors (e.g. ['#0891b2', '#d97706', '#c026d3']).

modeDefault: 'edge-contrast'

'edge-contrast' | 'sequential'

Optimizes palette placement across 1-hop edges or assigns sequentially by cluster index.

preserveMatchedColorsDefault: true

boolean

Preserves assigned brand swatches across live data mutations.

Brand Tokens Meet Perceptual OKLab Blending

Custom Brand Palette converts your supplied sRGB hex colors into OKLab tuples, assigns them onto the 60° mesh to maximize perceptual contrast across adjacent triangle edges (mode: 'edge-contrast'), and computes mixedColorHex for multi-cluster items in OKLab space so even custom corporate palettes produce clean, legible intermediate blends.

Usage Example

import {
  SimplexTopicGraph,
  createPaletteColorStrategy,
} from '@simplex-viz/react';

const brandColors = createPaletteColorStrategy(
  ['#0891b2', '#d97706', '#c026d3', '#059669', '#2563eb', '#e11d48'],
  { mode: 'edge-contrast' },
);

<SimplexTopicGraph items={items} colorStrategy={brandColors} />;