{
  "x402Version": 2,
  "id": 5891,
  "slug": "5891",
  "resource": "https://402utils.com/v1/color",
  "description": "Colour utilities: ?op=convert (default) turns any hex/rgb()/hsl()/CSS-name into hex, rgb, hsl, hsv, alpha, relative luminance and exact CSS name; ?op=contrast with ?fg=&bg= returns the WCAG 2.x contrast ratio and AA/AAA pass/fail for normal & large text plus UI components (accessibility / EAA); ?op=palette derives complementary, analogous, triadic, tints and shades. Send hex without '#'.",
  "type": "http",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xc55A2D530b53CBaD1001e4AfD4720B7E71f9C291",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "1000",
      "maxTimeoutSeconds": 60
    }
  ],
  "outputSchema": {
    "bazaar": {
      "info": {
        "input": {
          "method": "GET",
          "queryParams": {
            "bg": "ffffff",
            "fg": "000000",
            "op": "contrast"
          },
          "type": "http"
        },
        "output": {
          "example": {
            "AA": {
              "largeText": true,
              "normalText": true,
              "uiComponents": true
            },
            "AAA": {
              "largeText": true,
              "normalText": true
            },
            "bg": {
              "hex": "#ffffff",
              "input": "ffffff"
            },
            "fg": {
              "hex": "#000000",
              "input": "000000"
            },
            "op": "contrast",
            "ratio": 21
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "method": {
                "enum": [
                  "GET"
                ],
                "type": "string"
              },
              "queryParams": {
                "description": "Query string only.",
                "properties": {
                  "bg": {
                    "description": "Background colour (op=contrast). Falls back to `color` for fg.",
                    "type": "string"
                  },
                  "color": {
                    "description": "The colour (convert/palette): hex without '#', rgb(), hsl() or a CSS name.",
                    "type": "string"
                  },
                  "fg": {
                    "description": "Foreground colour (op=contrast).",
                    "type": "string"
                  },
                  "op": {
                    "default": "convert",
                    "enum": [
                      "convert",
                      "contrast",
                      "palette"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "description": "Shape depends on `op`.",
                "properties": {
                  "AA": {
                    "description": "AA pass/fail for normalText, largeText, uiComponents.",
                    "type": "object"
                  },
                  "AAA": {
                    "description": "AAA pass/fail for normalText, largeText.",
                    "type": "object"
                  },
                  "analogous": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "complementary": {
                    "description": "(op=palette).",
                    "type": "string"
                  },
                  "hex": {
                    "type": "string"
                  },
                  "hsl": {
                    "type": "object"
                  },
                  "hsv": {
                    "type": "object"
                  },
                  "luminance": {
                    "description": "WCAG relative luminance 0-1 (op=convert).",
                    "type": "number"
                  },
                  "name": {
                    "description": "Exact CSS colour name, if any.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "op": {
                    "type": "string"
                  },
                  "ratio": {
                    "description": "WCAG contrast ratio 1-21 (op=contrast).",
                    "type": "number"
                  },
                  "rgb": {
                    "type": "object"
                  },
                  "shades": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "tints": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "triadic": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "op"
                ],
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "bazaar"
  ],
  "sourceHost": "402utils.com",
  "lastUpdated": "2026-09-17T04:00:18.268Z",
  "quality": {
    "calls30d": 6,
    "uniquePayers30d": 5,
    "lastCalledAt": "2026-09-17T03:59:58.753Z"
  },
  "liveness": {},
  "verified": false,
  "featured": false,
  "provider": {
    "host": "402utils.com",
    "manifest_name": "402utils.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-09-18T22:00:31.484Z"
  }
}