diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fd782d9..734aee19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## Unreleased +### Features +- **configurator:** colour fields now accept any CSS colour format — paste a hex, `rgb()`, `hsl()`, a named colour, `lab()`/`lch()`, `color()`, etc. and it is converted automatically into the token's canonical space (OKLCH, or OKLAB where that is the field's default). Conversion uses the browser's own colour engine, so it matches exactly what gets painted; `var()` references and already-canonical values pass through untouched. + ## [0.7.24] - 2026-07-19 ### Features diff --git a/configurator/src/components/inputs/ColorInput.svelte b/configurator/src/components/inputs/ColorInput.svelte index ffa66e25..83a49bd6 100644 --- a/configurator/src/components/inputs/ColorInput.svelte +++ b/configurator/src/components/inputs/ColorInput.svelte @@ -1,6 +1,7 @@
@@ -62,7 +77,9 @@
{label}
{shortName}
-
{value}
+
+ {value}{#if hex} · {hex}{/if} +
{#if overridden}
@@ -134,23 +151,15 @@ type="text" value={localRaw || value} oninput={(e) => { localRaw = (e.target as HTMLInputElement).value; }} - onblur={() => { - if (localRaw.trim()) { - onChange(localRaw.trim()); - localRaw = ""; - } - }} + onblur={commitRaw} onkeydown={(e) => { if (e.key === "Enter") { - if (localRaw.trim()) { - onChange(localRaw.trim()); - localRaw = ""; - } + commitRaw(); (e.currentTarget as HTMLInputElement).blur(); } }} class="flex-1 bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-lg px-2 py-1.5 text-[10px] font-mono text-slate-800 dark:text-slate-200 focus:outline-none focus:border-indigo-500" - placeholder="oklch(0.6 0.15 264)" + placeholder="oklch(…) · paste #hex, rgb(), hsl()…" /> {#if overridden}