Skip to main content
POST
/
tools
/
color-converter
/
hsl-to-hex
Convert HSL to Hex
curl --request POST \
  --url https://api.dirtroad.dev/tools/color-converter/hsl-to-hex \
  --header 'Content-Type: application/json' \
  --header 'X-Payment: <api-key>' \
  --data '{
  "h": 0,
  "s": 100,
  "l": 50
}'
{
  "original": {
    "h": 123,
    "s": 123,
    "l": 123
  },
  "result": "#FF0000"
}

Authorizations

X-Payment
string
header
required

x402 blockchain payment authorization header containing signed EIP-3009 Transfer with Authorization

Body

application/json
h
number
required

Hue (0-360 degrees)

Required range: 0 <= x <= 360
Example:

0

s
number
required

Saturation (0-100%)

Required range: 0 <= x <= 100
Example:

100

l
number
required

Lightness (0-100%)

Required range: 0 <= x <= 100
Example:

50

Response

HSL values converted to hex color code

original
object
result
string

Hex color code

Example:

"#FF0000"