Paint-Mixer Colour Picker

Motion Components · Vol. 1

Component

Paint-Mixer Colour Picker

Variants

The same markup works as a compact, plain-CSS colour picker with no WebGL: sizes and states below. The swatch and hex readout always show the real mixed colour.

Compact, a warm orange
Default, a leafy green: drag the tubes or use the arrow keys
Disabled

Usage

Paste the markup, include assets/css/tokens.css and assets/css/tailwind.css, then run the script from this page.

Accessibility

  • Role and state. Each pigment is a real role="slider" (0 to 100) with a readable aria-valuetext. The mixed colour is a polite live-region output, so a screen reader hears "#7A4FD0" every time the mix changes. The pot buttons are real buttons.
  • Keyboard. Tab through the four pigments. Arrow keys move by 1, PageUp and PageDown by 10, Home and End jump to 0 and 100. Enter or Space on a pot pours 20 more. "Use this colour" copies the hex; "Rinse" clears the bowl.
  • Reduced motion. With prefers-reduced-motion the blobs jump straight to their positions, the splats, colour wave and marbling swirl are skipped, and the hex and swatch always tell you the colour.
  • Touch and contrast. Tubes are at least 40px tall with pointer capture, so dragging does not scroll the page. The panel sits on a solid token-coloured card, so text keeps its contrast in both themes.