Design
RGB <-> OKLCH API
Converts between sRGB/hex and OKLCH (perceptual cylindrical: lightness, chroma, hue), both directions, plus the ready-to-use CSS oklch() string. Answers 'What is the OKLCH of this color?', 'Give me the CSS oklch() value.'
Price$0.04per request
MethodPOST
Route/v1/design/oklch-convert
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
coloroklchperceptualcss-color-4chromahueconvertdesigncolorspace
API URL
Integration docshttps://x402.hexl.dev/v1/design/oklch-convertExample request
{
"color": "#ff6347"
}Example response
{
"direction": "rgb->oklch",
"input": "#ff6347",
"hex": "#ff6347",
"rgb": {
"r": 255,
"g": 99,
"b": 71
},
"hsl": {
"h": 9.13,
"s": 100,
"l": 63.92
},
"oklab": {
"L": 0.696,
"a": 0.165,
"b": 0.105
},
"oklch": {
"L": 0.696,
"c": 0.196,
"h": 32.321
},
"css": "oklch(69.62% 0.1955 32.32)"
}Input schema
{
"type": "object",
"properties": {
"color": {
"type": "string",
"examples": [
"#ff6347"
]
},
"oklch": {
"type": "object",
"properties": {
"L": {
"type": "number"
},
"c": {
"type": "number"
},
"h": {
"type": "number"
}
}
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}