Color Brightness Calculator API

GET

Know if any color is light, medium, or dark.

Color Brightness Calculator checks hex color brightness to classify values as light, dark, or medium, returning RGB components. Paid plans add WCAG contrast ratios, luminance scores, and recommended text colors.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/colorbrightness?hex=FF5733
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "hex": "#FF5733",
    "rgb": {
      "r": 255,
      "g": 87,
      "b": 51
    },
    "luminance": 0.2832,
    "perceived_brightness": 131,
    "yiq": 133.13,
    "is_light": false,
    "is_dark": true,
    "brightness_category": "dark",
    "recommended_text_color": "#FFFFFF",
    "contrast_ratio_with_white": 3.15,
    "contrast_ratio_with_black": 6.66,
    "wcag_aa_compliant_with_white": false,
    "wcag_aa_compliant_with_black": true,
    "wcag_aaa_compliant_with_white": false,
    "wcag_aaa_compliant_with_black": false
  }
}

About the Color Brightness Calculator API

Color Brightness Calculator works by applying WCAG 2.0 relative luminance formulas to RGB color values, calculating contrast ratios with black and white, and determining optimal text colors for accessibility.

What people use it for

Web Accessibility
Ensure WCAG compliance by calculating contrast ratios for text and background colors
UI Design
Determine appropriate text colors for backgrounds based on brightness calculations
Theme Development
Automatically select light or dark text based on background color brightness
Color Analysis
Analyze color brightness and categorize colors for design systems and palettes

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Color Brightness Calculator

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Color Brightness Calculator API.

Read the docs →
How are the brightness and contrast ratios calculated?
Calculations follow standard WCAG 2.0 relative luminance formulas applied to RGB values. On paid plans, the API evaluates contrast ratios against black and white to check WCAG AA and AAA compliance thresholds.
Do I get WCAG compliance flags and recommended text colors on the Free plan?
No, WCAG compliance indicators and recommended text colors require a paid plan. The Free plan returns basic RGB components and light or dark classifications. Upgrading to Starter or above unlocks relative luminance, perceived brightness, YIQ scores, contrast ratios, and AA or AAA compliance checks.
Which plan fits 50,000 color checks a month?
The Starter plan covers 50,000 checks comfortably. Each call uses 2 credits, meaning 50,000 checks consume 100,000 of the 200,000 monthly credits available on Starter, working out to about $0.30 per 1,000 calls. The Free plan provides 100 calls per month for evaluation.
Does the API accept hex codes without a hash symbol?
Yes, hex color strings can be provided with or without the leading # character. Both formats are parsed directly into their RGB components.
Does the check evaluate both WCAG AA and AAA standards?
Yes, on paid plans, the API evaluates both WCAG AA and WCAG AAA compliance levels. It provides separate boolean results for black and white pairings across both tiers along with the raw contrast ratios.

Ready to build with Color Brightness Calculator? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs