← All work
Creative tech · WebGL

chroma-gem

A React package that grows faceted crystal marks from a seed, so the same settings always draw the same gem, with ripples that travel facet to facet.

2026

Overview

chroma-gem is a React component package and a tuning studio for generating faceted, crystal like brand marks. A site drops in one component, gives it a seed and a config, and gets an animated gem for a hero or header.

A hexagonal gem built from triangular facets shading from cyan and orange at the top to deep blue and violet at the bottom, on a dark canvas.
A faceted gem drawn by the engine from the baseline profile.
A dark control interface with a list of render stages, sliders for fill opacity, scale and offsets, and a multicolored faceted hexagon on the right.
The tuning studio: pipeline stages on the left, facet controls in the middle, the live gem on the right.

My role

Creator: design and engineering.

How it works

  • Determinism: Nothing in the engine calls Math.random or Date.now. Variation comes from hashing the seed and config, so the same input draws the same frame on any machine. Saved custom profiles and interface themes get their ids from a hash of their own content.
  • Geometry: Six layouts build the gem from hexagonal matrices, radial rings and cartesian triangles. A reveal animation can run from the center out, top down, or at random, as a fade, a scale, a wire-to-fill or a shimmer. Geometry can bleed past its frame under a grayscale, ghost or darken filter, or be hard-cropped.
  • Ripples follow edges: The engine precomputes which facets touch. A click starts a breadth-first walk across that neighbor graph, so a wave follows the shape's own edges instead of a circle that ignores them. Moving the cursor sends waves with no click.
  • Colors diffuse: Injected colors blur, decay and carry momentum from facet to facet like liquid paint, controlled by viscosity and a thermal decay that returns them to the base theme. Color mixing uses continuous-time decay and smoothstep curves so overlapping waves do not blow out to white.
  • Rendering: A request-animation-frame loop calculates facet state in typed arrays and writes it to the page directly. React draws the SVG skeleton once and is not re-rendered per frame, which keeps hundreds of animated facets moving. The same config can be drawn by a DOM renderer or a WebGL one. Vignette, film grain and chromatic aberration passes are built in.
  • Tuning studio: A studio app exposes the pipeline stages, facet controls and a live gem. The package also exports a provider and hook for building your own controls.

Its limits

The package is not published and has no public demo. The studio's own interface styling is left out of the exported package.

Status

Package version 0.2.6. The last code changes were in March 2026.