Documentation

API URL


POST /api/v1/color-convert

Headers
Code
Content-Type: application/json
Body Parameters


Example Request

Code
GET https://datpaq.com/api/v1/color-convert?api_key=your-api-key&color=3b82f6&contrast_with=ffffff&gradient_angle=135

Successful Response

Status
HTML
200 OK
Body
Code
{
  "success": true,
  "input": "#3B82F6",
  "color": {
    "hex": "#3B82F6",
    "hex_clean": "3B82F6",
    "rgb": {
      "r": 59,
      "g": 130,
      "b": 246,
      "a": 1,
      "css": "rgb(59, 130, 246)",
      "values": [
        59,
        130,
        246
      ]
    },
    "hsl": {
      "h": 217,
      "s": 91,
      "l": 60,
      "a": 1,
      "css": "hsl(217, 91%, 60%)",
      "values": [
        217,
        91,
        60
      ]
    },
    "hsv": {
      "h": 217,
      "s": 76,
      "v": 96,
      "a": 1,
      "css": "hsv(217, 76%, 96%)",
      "values": [
        217,
        76,
        96
      ]
    },
    "cmyk": {
      "c": 76,
      "m": 47,
      "y": 0,
      "k": 4,
      "css": "cmyk(76%, 47%, 0%, 4%)",
      "values": [
        76,
        47,
        0,
        4
      ]
    },
    "lab": {
      "l": 54.62,
      "a": 8.76,
      "b": -65.79,
      "css": "lab(54.62% 8.76 -65.79)",
      "values": [
        54.62,
        8.76,
        -65.79
      ]
    },
    "oklab": {
      "l": 0.6231,
      "a": -0.0332,
      "b": -0.1851,
      "alpha": 1,
      "css": "oklab(0.6231 -0.0332 -0.1851)"
    },
    "oklch": {
      "l": 0.6231,
      "c": 0.1881,
      "h": 259.83,
      "alpha": 1
    },
    "xyz": {
      "x": 26.41,
      "y": 23.55,
      "z": 90.32
    }
  },
  "luminance": 0.2355,
  "contrast": {
    "white": {
      "ratio": 3.68,
      "wcag_aa_normal": false,
      "wcag_aa_large": true,
      "wcag_aaa_normal": false,
      "wcag_aaa_large": false
    },
    "black": {
      "ratio": 5.71,
      "wcag_aa_normal": true,
      "wcag_aa_large": true,
      "wcag_aaa_normal": false,
      "wcag_aaa_large": true
    },
    "recommended_text_color": "#000000",
    "composited_against": "#FFFFFF",
    "apca": {
      "available": false,
      "black_on_color": null,
      "white_on_color": null,
      "standard": null,
      "reason": "APCA is gated pending compliant implementation and license review"
    },
    "custom": {
      "compare_color": "#FFFFFF",
      "ratio": 3.68,
      "wcag_aa_normal": false,
      "wcag_aa_large": true,
      "wcag_aaa_normal": false,
      "wcag_aaa_large": false
    }
  },
  "palette": {
    "complementary": [
      {
        "hex": "#3C83F6",
        "rgb": "rgb(60, 131, 246)",
        "hsl": "hsl(217, 91%, 60%)"
      },
      {
        "hex": "#F6AF3C",
        "rgb": "rgb(246, 175, 60)",
        "hsl": "hsl(37, 91%, 60%)"
      }
    ],
    "analogous": [
      {
        "hex": "#3CE0F6",
        "rgb": "rgb(60, 224, 246)",
        "hsl": "hsl(187, 91%, 60%)"
      },
      {
        "hex": "#3C83F6",
        "rgb": "rgb(60, 131, 246)",
        "hsl": "hsl(217, 91%, 60%)"
      },
      {
        "hex": "#523CF6",
        "rgb": "rgb(82, 60, 246)",
        "hsl": "hsl(247, 91%, 60%)"
      }
    ],
    "triadic": [
      {
        "hex": "#3C83F6",
        "rgb": "rgb(60, 131, 246)",
        "hsl": "hsl(217, 91%, 60%)"
      },
      {
        "hex": "#F63C83",
        "rgb": "rgb(246, 60, 131)",
        "hsl": "hsl(337, 91%, 60%)"
      },
      {
        "hex": "#83F63C",
        "rgb": "rgb(131, 246, 60)",
        "hsl": "hsl(97, 91%, 60%)"
      }
    ],
    "tetradic": [
      {
        "hex": "#3C83F6",
        "rgb": "rgb(60, 131, 246)",
        "hsl": "hsl(217, 91%, 60%)"
      },
      {
        "hex": "#F63CE0",
        "rgb": "rgb(246, 60, 224)",
        "hsl": "hsl(307, 91%, 60%)"
      },
      {
        "hex": "#F6AF3C",
        "rgb": "rgb(246, 175, 60)",
        "hsl": "hsl(37, 91%, 60%)"
      },
      {
        "hex": "#3CF652",
        "rgb": "rgb(60, 246, 82)",
        "hsl": "hsl(127, 91%, 60%)"
      }
    ],
    "split_complementary": [
      {
        "hex": "#3C83F6",
        "rgb": "rgb(60, 131, 246)",
        "hsl": "hsl(217, 91%, 60%)"
      },
      {
        "hex": "#F6523C",
        "rgb": "rgb(246, 82, 60)",
        "hsl": "hsl(7, 91%, 60%)"
      },
      {
        "hex": "#E0F63C",
        "rgb": "rgb(224, 246, 60)",
        "hsl": "hsl(67, 91%, 60%)"
      }
    ],
    "monochromatic": [
      {
        "hex": "#031E49",
        "rgb": "rgb(3, 30, 73)",
        "hsl": "hsl(217, 91%, 15%)"
      },
      {
        "hex": "#07409C",
        "rgb": "rgb(7, 64, 156)",
        "hsl": "hsl(217, 91%, 32%)"
      },
      {
        "hex": "#0B64F4",
        "rgb": "rgb(11, 100, 244)",
        "hsl": "hsl(217, 91%, 50%)"
      },
      {
        "hex": "#639CF8",
        "rgb": "rgb(99, 156, 248)",
        "hsl": "hsl(217, 91%, 68%)"
      },
      {
        "hex": "#B6D1FC",
        "rgb": "rgb(182, 209, 252)",
        "hsl": "hsl(217, 91%, 85%)"
      }
    ],
    "tints": [
      {
        "percentage": "0%",
        "hex": "#3B82F6",
        "rgb": "rgb(59, 130, 246)"
      },
      {
        "percentage": "20%",
        "hex": "#629BF8",
        "rgb": "rgb(98, 155, 248)"
      },
      {
        "percentage": "40%",
        "hex": "#89B4FA",
        "rgb": "rgb(137, 180, 250)"
      },
      {
        "percentage": "60%",
        "hex": "#B1CDFB",
        "rgb": "rgb(177, 205, 251)"
      },
      {
        "percentage": "80%",
        "hex": "#D8E6FD",
        "rgb": "rgb(216, 230, 253)"
      }
    ],
    "shades": [
      {
        "percentage": "0%",
        "hex": "#3B82F6",
        "rgb": "rgb(59, 130, 246)"
      },
      {
        "percentage": "20%",
        "hex": "#2F68C5",
        "rgb": "rgb(47, 104, 197)"
      },
      {
        "percentage": "40%",
        "hex": "#234E94",
        "rgb": "rgb(35, 78, 148)"
      },
      {
        "percentage": "60%",
        "hex": "#183462",
        "rgb": "rgb(24, 52, 98)"
      },
      {
        "percentage": "80%",
        "hex": "#0C1A31",
        "rgb": "rgb(12, 26, 49)"
      }
    ]
  },
  "nearest_name": {
    "name": "Dodger Blue",
    "keyword": "dodgerblue",
    "hex": "#1E90FF",
    "distance": 8.77,
    "exact_match": false
  },
  "color_vision": {
    "protanopia": {
      "r": 65,
      "g": 142,
      "b": 250
    },
    "deuteranopia": {
      "r": 0,
      "g": 125,
      "b": 244
    },
    "tritanopia": {
      "r": 0,
      "g": 158,
      "b": 176
    },
    "achromatopsia": {
      "r": 133,
      "g": 133,
      "b": 133
    }
  },
  "gradients": {
    "linear": "linear-gradient(135deg, #3B82F6 0%, #F6AF3C 100%)",
    "radial": "radial-gradient(circle, #3B82F6 0%, #F6AF3C 100%)"
  },
  "metadata": {
    "correlationId": "example-request",
    "timestamp": "2026-10-08T12:00:00.000Z",
    "processingTime": "8ms",
    "api_token_name": "QA",
    "rate_limit": {
      "limit": 100,
      "remaining": 99,
      "reset": 1791460860
    }
  }
}

Error Response

Example
Code
HTTP 400 VALIDATION_ERROR: Missing or invalid input/options — Request could not complete; HTTP 400 INVALID_JSON: Malformed JSON body — Request could not complete; HTTP 401 AuthenticationError: Gateway authentication failure — Request could not complete; HTTP 404 NOT_FOUND: Unknown service route — Request could not complete; HTTP 413 PAYLOAD_TOO_LARGE: JSON body exceeds 16 KiB — Request could not complete; HTTP 429 RATE_LIMITED: More than 120 requests per 15 minutes — Request could not complete; HTTP 500 INTERNAL_ERROR: Unexpected processing failure — Request could not complete

Last Updated:  May 4, 2026