{
  "x402Version": 2,
  "id": 27071,
  "slug": "27071",
  "resource": "https://keyronne.com/api/color",
  "description": "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\"}",
  "type": "http",
  "serviceName": "Color Convert + Contrast",
  "resourceType": "Agent Service",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xB86F95EF5FA904318Ea9Df3b59AdCe099b478fC4",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "1000",
      "amountUsd": 0.001,
      "maxTimeoutSeconds": 60
    }
  ],
  "outputSchema": {
    "properties": {
      "adjusted": {
        "description": "Present when lighten/darken is given.",
        "type": "string"
      },
      "contrast": {
        "description": "Present when \"background\" is given.",
        "type": "object"
      },
      "hex": {
        "type": "string"
      },
      "hsl": {
        "type": "object"
      },
      "luminance": {
        "type": "number"
      },
      "mixed": {
        "description": "Present when \"mix\" is given.",
        "type": "string"
      },
      "rgb": {
        "type": "object"
      }
    },
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "background": "#ffffff",
            "color": "#3498db"
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "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
            }
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "properties": {
              "body": {
                "properties": {
                  "background": {
                    "description": "Optional second color for a WCAG contrast check.",
                    "type": "string"
                  },
                  "color": {
                    "description": "A color: \"#3498db\", \"rgb(52,152,219)\", or \"hsl(204,70%,53%)\".",
                    "type": "string"
                  },
                  "darken": {
                    "description": "Decrease lightness by this many percent (0-100).",
                    "type": "number"
                  },
                  "lighten": {
                    "description": "Increase lightness by this many percent (0-100).",
                    "type": "number"
                  },
                  "mix": {
                    "description": "Blend the color toward this one.",
                    "type": "string"
                  },
                  "weight": {
                    "default": 0.5,
                    "description": "Mix weight toward \"mix\".",
                    "maximum": 1,
                    "minimum": 0,
                    "type": "number"
                  }
                },
                "required": [
                  "color"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "type": "object"
          },
          "output": {
            "properties": {
              "adjusted": {
                "description": "Present when lighten/darken is given.",
                "type": "string"
              },
              "contrast": {
                "description": "Present when \"background\" is given.",
                "type": "object"
              },
              "hex": {
                "type": "string"
              },
              "hsl": {
                "type": "object"
              },
              "luminance": {
                "type": "number"
              },
              "mixed": {
                "description": "Present when \"mix\" is given.",
                "type": "string"
              },
              "rgb": {
                "type": "object"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "color",
    "hex",
    "rgb",
    "wcag",
    "contrast",
    "bazaar"
  ],
  "sourceHost": "keyronne.com",
  "lastUpdated": "2026-10-08T21:11:36.492Z",
  "quality": {
    "calls30d": 4,
    "uniquePayers30d": 4,
    "lastCalledAt": "2026-10-08T21:11:36.15Z"
  },
  "metadata": {
    "serviceName": "Color Convert + Contrast",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "body": {
              "background": "#ffffff",
              "color": "#3498db"
            },
            "bodyType": "json",
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "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
              }
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "properties": {
                "body": {
                  "properties": {
                    "background": {
                      "description": "Optional second color for a WCAG contrast check.",
                      "type": "string"
                    },
                    "color": {
                      "description": "A color: \"#3498db\", \"rgb(52,152,219)\", or \"hsl(204,70%,53%)\".",
                      "type": "string"
                    },
                    "darken": {
                      "description": "Decrease lightness by this many percent (0-100).",
                      "type": "number"
                    },
                    "lighten": {
                      "description": "Increase lightness by this many percent (0-100).",
                      "type": "number"
                    },
                    "mix": {
                      "description": "Blend the color toward this one.",
                      "type": "string"
                    },
                    "weight": {
                      "default": 0.5,
                      "description": "Mix weight toward \"mix\".",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    }
                  },
                  "required": [
                    "color"
                  ],
                  "type": "object"
                },
                "bodyType": {
                  "enum": [
                    "json"
                  ],
                  "type": "string"
                },
                "method": {
                  "enum": [
                    "POST"
                  ],
                  "type": "string"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "output": {
              "properties": {
                "adjusted": {
                  "description": "Present when lighten/darken is given.",
                  "type": "string"
                },
                "contrast": {
                  "description": "Present when \"background\" is given.",
                  "type": "object"
                },
                "hex": {
                  "type": "string"
                },
                "hsl": {
                  "type": "object"
                },
                "luminance": {
                  "type": "number"
                },
                "mixed": {
                  "description": "Present when \"mix\" is given.",
                  "type": "string"
                },
                "rgb": {
                  "type": "object"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "keyronne.com",
    "manifest_name": "keyronne.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "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
    }
  }
}