Custom Brand Palette
Maps custom design-system hex colors onto the mesh with edge-contrast optimization.
- Stage 03: OKLab Color Science
- Built-In Preset
- 2 min read
- Updated 2026-11-15
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
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} />;