JSPM

tweakpane-plugin-wide-gamut

0.2.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 49
  • Score
    100M100P100Q88015F
  • License MIT

Wide-gamut colour picker for Tweakpane v4 — the native picker UI with an sRGB/P3 gamut boundary, across 11 colour spaces (HEX, RGB, CSS, HSL, HWB, OKLCH, OKLab, LCH, Lab, P3, Rec2020). No runtime dependencies — the colour maths is built in.

Package Exports

  • tweakpane-plugin-wide-gamut
  • tweakpane-plugin-wide-gamut/dist/tweakpane-plugin-wide-gamut.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tweakpane-plugin-wide-gamut) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tweakpane-plugin-wide-gamut

npm CI Tweakpane v4 license

The expanded picker: an OKLCH colour area with the sRGB/P3 gamut boundary, a hue strip, and the OKLCH mode dropdown with L/C/H inputs

A wide-gamut colour picker for Tweakpane v4. It mirrors the native colour picker and adds an sRGB / P3 gamut boundary on the OKLCH L×C plane, plus 11 colour spaces to read and edit in. Live demo ↗

  • Drop-in — registered once, it claims any colour-string binding; no view parameter.
  • 11 spaces — HEX, RGB, CSS, HSL, HWB, OKLCH, OKLab, LCH, Lab, P3, Rec2020.
  • Wide-gamut — the sRGB/P3 boundary draws on the OKLCH plane; values keep their source format and support alpha.

Usage

npm install tweakpane-plugin-wide-gamut tweakpane
import {Pane} from 'tweakpane';
import * as WideGamutPlugin from 'tweakpane-plugin-wide-gamut';

const pane = new Pane();
pane.registerPlugin(WideGamutPlugin);

pane.addBinding({brand: 'oklch(0.7 0.15 250)'}, 'brand');

How it works

The colour maths — conversions across all 11 spaces, gamut testing, and gamut mapping — is written straight from the CSS Color 4 specification (and Björn Ottosson's OKLab), with no runtime colour-library dependency.