Hex to RGB

Hex to RGB Endpoint

This endpoint converts a hexadecimal color code into its RGB components, providing detailed information about each color component (red, green, and blue) and its corresponding percentage.

Endpoint

  • URL: https://api.erensko.xyz/v1/hex-to-rgb

  • Method: GET

  • Description: Converts a given hexadecimal color code into RGB format. The response includes details about each component (red, green, blue), their values, percentages, and the overall conversion success.

URL Parameters

Key
Value

hex

The he color code to convert into RGB, #FFFFFF for example.

Headers

Key
Value

Authorization

Your own personal API key, create one by clicking here. This is required.

Request Example

GET https://api.erensko.xyz/v1/hex-to-rgb?hex=#FFFFFF

Example Response:

{
  "originalHex": "#FFFFFF",
  "rgb": {
    "r": {
      "value": 255,
      "description": "Red component of the color",
      "percentage": "100%",
      "validity": true
    },
    "g": {
      "value": 255,
      "description": "Green component of the color",
      "percentage": "100%",
      "validity": true
    },
    "b": {
      "value": 255,
      "description": "Blue component of the color",
      "percentage": "100%",
      "validity": true
    }
  },
  "mainRgb": "255, 255, 255",
  "conversionSuccess": true,
  "timestamp": "2024-11-08T00:13:01.340Z"
}

Last updated