Skip to main content
POST
/
tools
/
color-converter
/
hex-to-rgb
Convert Hex to RGB
curl --request POST \
  --url https://api.dirtroad.dev/tools/color-converter/hex-to-rgb \
  --header 'Content-Type: application/json' \
  --header 'X-Payment: <api-key>' \
  --data '{
  "hex": "#FF0000"
}'
{
  "original": "<string>",
  "result": {
    "r": 127.5,
    "g": 127.5,
    "b": 127.5
  }
}

Authorizations

X-Payment
string
header
required

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

Body

application/json
hex
string
required

Hex color code (with or without # prefix)

Example:

"#FF0000"

Response

Hex color converted to RGB values

original
string

Original hex color input

result
object