Catalog/design-xyz-convert

Design

RGB <-> CIE-XYZ API

Converts between sRGB/hex and CIE 1931 XYZ tristimulus values (D65), plus the xy chromaticity coordinates, both directions. Answers 'What are the XYZ tristimulus values?', 'What are the xy chromaticity coordinates?'

Price$0.04per request
MethodPOST
Route/v1/design/xyz-convert
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
colorxyzcie1931tristimuluschromaticityd65convertcolorspacedesign
API URLhttps://x402.hexl.dev/v1/design/xyz-convert
Integration docs
Example request
{
  "color": "#ff6347"
}
Example response
{
  "direction": "rgb->xyz",
  "input": "#ff6347",
  "hex": "#ff6347",
  "rgb": {
    "r": 255,
    "g": 99,
    "b": 71
  },
  "hsl": {
    "h": 9.13,
    "s": 100,
    "l": 63.92
  },
  "xyz": {
    "x": 46.844,
    "y": 30.645,
    "z": 9.408
  },
  "chromaticity": {
    "x": 0.5391,
    "y": 0.3527
  },
  "whitePoint": "D65/2°"
}
Input schema
{
  "type": "object",
  "properties": {
    "color": {
      "type": "string",
      "examples": [
        "#ff6347",
        "white"
      ]
    },
    "xyz": {
      "type": "object",
      "properties": {
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "z": {
          "type": "number"
        }
      }
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}