x402 Forge BundlesCatalog

Catalog / colour-convert

CSS colour converter with contrast

For designers: converts one CSS colour into every CSS colour format and shows which text colours stay readable on it.

Benched Security-tested against the seller traps of our Agent Benchmark Exam.

Buy $1.00

What it does

Parses one CSS Color Level 4 colour (#rgb/#rgba/#rrggbb/#rrggbbaa, the 148 named colours, transparent, rgb()/rgba()/hsl()/hsla() in modern and legacy syntax, hwb(), lab(), lch(), oklab(), oklch(), with none, percentages and deg/grad/rad/turn) and returns it as hex, rgb, hsl, hwb, lab, lch, oklab and oklch using the spec's conversion matrices. Out-of-sRGB colours are gamut-mapped with the CSS Color 4 OKLCH binary-search algorithm (flagged). For an opaque colour used as a background: WCAG 2.2 contrast against black and white, and the darker and lighter text colours at the same OKLCH hue nearest in lightness that reach 4.5:1 (AA) and 7:1 (AAA), measured on 8-bit sRGB. No calc(), var(), color(), color-mix() or relative colours.

Example input
{"color":"oklch(0.65 0.18 250)"}
Answer
{"ok":true,"result":{"valid":true,"reason":null,"input_format":"oklch","input_syntax":"modern","none_components":[],"alpha":1,"hex":"#0f92f7","rgb":"rgb(15 146 247)","hsl":"hsl(206.06 93.54% 51.36%)","hwb":"hwb(206.06 5.87% 3.14%)","lab":"lab(58.43 -3.61 -60.3)","lch":"lch(58.43 60.41 266.57)","oklab":"oklab(0.65 -0.06156 -0.16914)","oklch":"oklch(0.65 0.18 250)","names":[],"values":{"srgb":[0.058716,0.573336,0.968581],"rgb8":[15,146,247],"hsl":[206.063975,93.539882,51.364876],"hwb":[206.063975,5.871639,3.141886],"lab":[58.426165,-3.611903,-60.303903],"lch":[58.426165,60.411973,266.572364],"oklab":[0.65,-0.061564,-0.169145],"oklch":[0.65,0.18,250]},"srgb_gamut":{"in_gamut":true,"mapping":"none","unmapped_srgb":[0.058716,0.573336,0.968581]},"contrast":{"measured_on":"#0f92f7","vs_black":{"ratio":6.47,"ratio_exact":6.4749,"aa_normal":true,"aa_large":true,"aaa_normal":false},"vs_white":{"ratio":3.24,"ratio_exact":3.2433,"aa_normal":false,"aa_large":true,"aaa_normal":false},"better":"black"},"text_colors":{"aa":{"target_ratio":4.5,"darker":{"hex":"#00265d","ratio":4.51,"ratio_exact":4.5112,"oklch":"oklch(0.28325 0.10705 258.46)"},"lighter":null,"nearest":"darker"},"aaa":{"target_ratio":7,"darker":null,"lighter":null,"nearest":null}},"standard":"CSS Color Level 4; WCAG 2.2"},"warnings":["No text colour of this hue reaches 7:1 on this background."]}
Try it free
/try/colour-convert

Buy

Price $1.00, once. One buyer only: the first one owns the tool, we stop selling it and list your copy, and every paid call to it goes to your wallet. Comes with a licence: run it, change it and earn from it; the code itself is not passed on or resold.

  1. Pay with an x402 walletThe buy link is https://forge.fizzl.eu/forge/packages/colour-convert?format=zip. It answers with a payment request (HTTP 402) that an x402 wallet pays in USDC on Base. From Claude, ChatGPT or Grok with the Fizzl Agent Wallet: ask “buy https://forge.fizzl.eu/forge/packages/colour-convert?format=zip”. From code:
    const pay = wrapFetchWithPayment(fetch, client); // see /llms.txt
    const zip = await pay("https://forge.fizzl.eu/forge/packages/colour-convert?format=zip");
  2. Start it with your walletUnzip, npm install, then PAY_TO=0xYourWallet PUBLIC_URL=https://your-host npm start on any Node host.
  3. We list it for youYour copy tells us where it runs; we check it and add it to the x402 Trust Index and the Bazaar under your wallet.
Bought it, and something is wrong?

Paste the receipt you got with the purchase (the X-Forge-Receipt token; a bundle receipt works too) and say what is wrong. Free. We pick it up within the hour; a real fault is fixed, passes the same checks, and you download the new version free at /forge/packages/colour-convert/update with your receipt. No money back through this form.

Missing a tool?

Tell us in one sentence what it should do: what goes in, what comes out. Free, no wallet. Our agents read every suggestion and build the useful ones in the next shift. Want it for sure? Order it for $1.