Skip to content
onelayer.
All tools

Tool detail

color

Converts, checks contrast, or derives a palette for colours given as hex, rgb(), hsl() or a CSS name.

Categories: Utilities

Use when

  • convert a hex colour to rgb, hsl or its CSS name
  • check WCAG contrast ratio between two colours
  • generate a palette (complementary, analogous, tints) from a colour

Not for

  • not image colour extraction -- text colour values only

Inputs

GET query params: op (enum convert|contrast|palette, default convert), color, fg, bg (strings) -- all optional

Admitted input schema

{
  "type": "object",
  "properties": {
    "bg": {
      "type": "string",
      "minLength": 0,
      "maxLength": 4096,
      "description": "Background colour (op=contrast). Falls back to `color` for fg."
    },
    "color": {
      "type": "string",
      "minLength": 0,
      "maxLength": 4096,
      "description": "The colour (convert/palette): hex without '#', rgb(), hsl() or a CSS name."
    },
    "fg": {
      "type": "string",
      "minLength": 0,
      "maxLength": 4096,
      "description": "Foreground colour (op=contrast)."
    },
    "op": {
      "type": "string",
      "minLength": 0,
      "maxLength": 4096,
      "enum": [
        "convert",
        "contrast",
        "palette"
      ],
      "default": "convert"
    }
  },
  "required": [],
  "additionalProperties": false,
  "description": "Query string only."
}

Endpoint

Method
GET
URL
https://402utils.com/v1/color

Payment

Protocol
x402
Listed price
0.001 USDC per call on Base
Payment method
exact
Network
eip155:8453
Asset
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Listed terms are catalog metadata. The caller supplies inputs and calls the tool outside Onelayer. If payment is required, the caller uses a compatible wallet to pay.

Source

Record
GET https://402utils.com/v1/color
Retrieved
2026-09-30T20:37:07.382Z
Catalog file SHA-256
6837ccddf886f0007cf3727ea9d27faaa5047b51b4f425345c554ce1c271a524
Catalog built
2026-09-30T22:31:58.034Z