Briolette
A spinnable sphere of colour facets. Pick one and the sphere repaints with close neighbours of it, so each choice narrows the next.
@patternmode/briolette
- Drag
- Spin the sphere
- Select
- Choose a facet and refine around it
- Again
- Select the pinned facet to clear
At rest the 80 facets span every hue around the equator and every lightness from pole to pole.
Reference
States and variants
Cut it coarse at 20 facets or fine at 320, and set how much of the seams show.
- Drag or use arrow keys to spin. Select a facet to refine the colors around it. Select the pinned facet again to clear.
80 facets
density="base" - Drag or use arrow keys to spin. Select a facet to refine the colors around it. Select the pinned facet again to clear.
Without the hex readout
showValue={false} - Drag or use arrow keys to spin. Select a facet to refine the colors around it. Select the pinned facet again to clear.
On a dark surface
seamColor, seamOpacity
Install and use
The value is a hex string, or null when nothing is chosen.
npm i @patternmode/brioletteimport { BriolettePicker } from "@patternmode/briolette";
import "@patternmode/briolette/styles.css";
export function AccentColorField() {
const [color, setColor] = useState<string | null>(null);
return (
<BriolettePicker
aria-label="Accent color"
value={color}
onChange={setColor}
/>
);
}Core API
BriolettePicker
Controlled hex picker rendered as a spinnable geodesic sphere. Selecting a facet glides it to the center and repaints the sphere with similar but distinct OKLab neighbors: hue rotates around the anchor, lightness shifts into its headroom, chroma swings with distance, and neutral anchors bloom into tints. Selecting the pinned facet again unsets the value.
value- string | nullControlled hex color value, or null when nothing is selected. Supplying a hex from outside re-anchors the sphere around the nearest facet and glides it to center.
onChange- (value: string | null) => voidCalled with the facet's hex color on selection, or null when unset.
density- "coarse" | "base" | "fine" | "brilliant""base"Facet density of the sphere. Coarse is 20 facets, base is 80, fine is 180, brilliant is 320. Changing the cut animates: the finer geometry grows out of the coarser one. Seam width scales with the cut.
seamOpacity- number1Seam visibility from 0 (a seamless gem) to 1 (full seams). Strokes blend toward each facet's own fill, so edges stay crack-free at every opacity.
seamColor- stringSeam color between facets. Defaults to the canvas white.
label- string"Color"Accessible name for the sphere stage.
showValue- booleantrueShows the selected hex output beneath the sphere.
size- number280Rendered sphere size in pixels.
Utilities
Pure geometry and perceptual colour helpers for custom renderers.
buildBrioletteFaces- () => BrioletteFace[]Builds the 80 facets of the frequency-2 geodesic icosahedron.
projectBrioletteFaces- (faces, orientation) => BrioletteProjectedFace[]Rotates, culls, and projects facets into SVG polygon points.
buildBriolettePalette- (faces, view) => string[]Computes every facet's hex for the universe or a refinement view.
brioletteUniverseColor- (direction) => stringMaps a facet direction to the at-rest color universe.
Keyboard and accessibility
Everything you can do by dragging, you can do with keys.
- Arrow keys
- Spin the sphere.
- Enter
- Selects the facet facing you.
- Escape
- Clears the value.
- label
- Names the sphere. Defaults to "Color".
- Reduced motion
- No idle drift, inertia or morphs. Only direct moves remain.
Package
- Package
- @patternmode/briolette
- Version
- 0.7.5
- Needs
- react, react-dom
- Licence
- MIT