16trust / 100

Color Contrast

by Vextorium in Documents & files

x402 APIFailing, checked 2 min ago

Convert a color between HEX, RGB, HSL, HSV and CMYK and, given a background, compute the WCAG 2.x contrast ratio with AA/AAA pass flags; without background, suggests black or white text.

POST https://api.vextorium.com/v1/color-contrast

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
0.0%
Response time
- typical, - slowest 5%
Last check
2 min ago: Amount "0.003" is not in atomic token units
Next check
in 1 h

How to call it

# bash or zsh: see the payment challenge (nothing is charged)
curl -g -i -X POST 'https://api.vextorium.com/v1/color-contrast' \
  -H 'content-type: application/json' \
  --data-raw '{"color":"#00ff66","fund":"#0d0e11"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.vextorium.com%2Fv1%2Fcolor-contrast
const res = await pay("https://api.vextorium.com/v1/color-contrast", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: "{\"color\":\"#00ff66\",\"fund\":\"#0d0e11\"}",
});
console.log(await res.json());

Example input

{
  "color": "#00ff66",
  "fund": "#0d0e11"
}

Example output

{
  "color": {
    "cmyk": [
      100,
      0
    ],
    "hex": "#00ff66",
    "hsl": [
      144,
      100
    ],
    "hsv": [
      144,
      100
    ],
    "luminance": 0.7248,
    "rgb": [
      0,
      255
    ]
  },
  "contrast": {
    "grande_text_AA": true,
    "grande_text_AAA": true,
    "normal_text_AA": true,
    "normal_text_AAA": true,
    "ratio": 14.24,
    "ui_components": true
  },
  "fund": {
    "cmyk": [
      24,
      18
    ],
    "hex": "#0d0e11",
    "hsl": [
      225,
      13
    ],
    "hsv": [
      225,
      24
    ],
    "luminance": 0.0044,
    "rgb": [
      13,
      14
    ]
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 min agoAmount "0.003" is not in atomic token units40284 ms$0.003
4 h agoAmount "0.003" is not in atomic token units40277 ms$0.003
9 h agoAmount "0.003" is not in atomic token units40285 ms$0.003
13 h agoAmount "0.003" is not in atomic token units40295 ms$0.003
17 h agoAmount "0.003" is not in atomic token units40287 ms$0.003
21 h agoAmount "0.003" is not in atomic token units40288 ms$0.003
26 h agoAmount "0.003" is not in atomic token units40289 ms$0.003
30 h agoAmount "0.003" is not in atomic token units40279 ms$0.003
34 h agoAmount "0.003" is not in atomic token units40270 ms$0.003
38 h agoAmount "0.003" is not in atomic token units40285 ms$0.003
42 h agoAmount "0.003" is not in atomic token units40285 ms$0.003
46 h agoAmount "0.003" is not in atomic token units40281 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40282 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40283 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40279 ms$0.003