C

Color Convert + Contrast · Color

by Color Convert + Contrast

POSTBase

$0.001

per call · USD Coin on Base

Parse any CSS color (hex, rgb(), hsl()) and emit all three formats plus relative luminance. Compute WCAG contrast ratios against a background with AA/AAA pass-fail for normal and large text, and lighten, darken, or mix colors. Built for agents generating accessible UI themes. POST a JSON body like: {"color":"#3498db","background":"#ffffff"}

Endpoint

POST https://keyronne.com/api/color

3

Calls / 30d

3

Unique payers / 30d

Sep 8

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://keyronne.com/api/color", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "background": "#ffffff",
    "color": "#3498db"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://keyronne.com/api/color" \
  -H "Content-Type: application/json" \
  -d '{"background":"#ffffff","color":"#3498db"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "contrast": {
    "against": "#ffffff",
    "largeTextAA": false,
    "normalTextAA": false,
    "ratio": 2.59
  },
  "hex": "#3498db",
  "hsl": {
    "h": 204,
    "l": 53.1,
    "s": 70
  },
  "input": "#3498db",
  "luminance": 0.2831,
  "rgb": {
    "a": 1,
    "b": 219,
    "g": 152,
    "r": 52
  }
}

Payment details

Pay to0xb86f95ef5fa904318ea9df3b59adce099b478fc4
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Social & Community and the homepage with a featured placement.

Get featured →

More from Color Convert + Contrast & similar services