Docs/Skills/Color Brightness Skill

Color Brightness Skill

Calculate if color is light or dark

OperationalCredits 1 per callp50 137msReference Data

Overview

The `hex` parameter accepts 3-, 6- or 8-digit hex, with or without `#`. Shorthand is expanded (`F53` becomes `FF5533`) and the alpha pair of an 8-digit value is dropped, so transparency has no effect. The echoed `hex` is upper-case with a leading `#`.

`luminance` is WCAG 2.0 relative luminance: each channel is divided by 255, linearised with the sRGB curve (values at or below 0.03928 are divided by 12.92, the rest raised through the 2.4 power), then weighted 0.2126, 0.7152 and 0.0722 for red, green and blue. It runs from 0 for black to 1 for white and is rounded to four decimals. `is_light` is true when black text has at least as much contrast on the color as white text does, which happens at a luminance of about 0.179 and above, and `is_dark` is its opposite. `brightness_category` splits at the same point: dark colors are `very dark` below 0.05, `dark` below 0.1 and `medium-dark` up to the crossover; light colors are `medium-light` below 0.5, `light` below 0.9 and `very light` from 0.9.

`contrast_ratio_with_white` is 1.05 divided by (luminance + 0.05), and `contrast_ratio_with_black` is (luminance + 0.05) divided by 0.05, both rounded to two decimals. The AA flags require 4.5 or more and the AAA flags 7 or more, the thresholds for normal-size text. `recommended_text_color` is `#000000` or `#FFFFFF`, whichever contrast ratio is higher, and always agrees with `is_light`: a mid-tone such as `#808080` (luminance 0.2159) is light, `medium-light`, and gets black text.

`perceived_brightness` is the plain average of the three channels on a 0 to 255 scale, and `yiq` is the weighted sum (299 R + 587 G + 114 B) / 1000. On the Free plan these, `luminance`, the contrast ratios, the WCAG flags and the recommendation are removed.

Live Test Color Brightness Skill Skill →

The tool

Once your client is connected to the VerveKit server, this appears in its tool list as ColorBrightnessSkill. It is read-only and open-world — it fetches and never mutates anything on your side — so most clients call it without asking you to confirm.

Tool call
{
  "name": "ColorBrightnessSkill",
  "arguments": {
    "hex": "FF5733"
  }
}

You do not name the tool yourself; the model picks it. Asking about FF5733 in the terms this skill covers is enough for it to reach for ColorBrightnessSkill on its own — naming it explicitly also works, and is the way to force the call.

Connecting

One server URL covers every skill in the catalog, including this one. Authorization is OAuth: the client opens a browser once, and there is no key to paste into a config file.

{
  "mcpServers": {
    "vervekit": {
      "url": "https://api.vervekit.com/v1/mcp"
    }
  }
}

Per-client setup — Claude, Cursor, VS Code, ChatGPT — is on the MCP setup page.

Arguments

These are the properties on the tool's inputSchema, so a well-behaved client validates them before the call is made. Premium arguments are accepted on every plan but only take effect on plans that include them.

ArgumentTypeDescription
hexRequiredstringHex color value (with or without # prefix)
hexColor

What the model gets back

The result carries a structuredContent object matching the tool's declared outputSchema, so a client reads fields without parsing prose. status is "ok" and error is null on success; a null field means the value was not available for that input, not that the call failed.

Result
{
  "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
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
hexstring#FF5733Hexadecimal color value provided in the request
rgbobject{…}RGB color components: red, green, blue values
rgb.rnumber255Red component value between 0 and 255
rgb.gnumber87Green component value between 0 and 255
rgb.bnumber51Blue component value between 0 and 255
luminancePremiumnumber0.2832Relative luminance calculated using WCAG 2.0 formula
perceived_brightnessPremiumnumber131Perceived brightness score from 0 to 255
yiqPremiumnumber133.13YIQ color space brightness value for brightness analysis
is_lightbooleanfalseTrue when black text contrasts better than white on this color (luminance about 0.179 or above)
is_darkbooleantrueTrue when white text contrasts better than black on this color; the opposite of is_light
brightness_categorystringdarkBrightness classification: very dark, dark, medium-dark, medium-light, light or very light; the dark buckets are exactly the colors that get white text
recommended_text_colorPremiumstring#FFFFFFRecommended text color for optimal contrast and readability
contrast_ratio_with_whitePremiumnumber3.15WCAG contrast ratio calculation between color and white
contrast_ratio_with_blackPremiumnumber6.66WCAG contrast ratio calculation between color and black
wcag_aa_compliant_with_whitePremiumbooleanfalseWhether color meets WCAG AA contrast requirements with white
wcag_aa_compliant_with_blackPremiumbooleantrueWhether color meets WCAG AA contrast requirements with black
wcag_aaa_compliant_with_whitePremiumbooleanfalseWhether color meets WCAG AAA contrast requirements with white
wcag_aaa_compliant_with_blackPremiumbooleanfalseWhether color meets WCAG AAA contrast requirements with black

Failure modes

Errors come back as tool errors carrying a sentence the model can act on, not a bare status code. Error handling covers the full list.

StatusWhat it means
400 / 422The arguments did not validate. The message names the offending one.
401The OAuth session is invalid or expired — reconnect the server.
403Blocked by a key restriction or an IP allow-list. Never a bad identity.
404This skill is not part of VerveKit. Check the catalog.
429Out of credits, or a brief rate limit. The message tells them apart.

A call costs 1 credit each time the tool actually runs; a model that reasons about the tool without calling it costs nothing.

Use cases

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

Other ways to use Color Brightness Skill

Set up Color Brightness Skill on VerveKit, or reach the same source a different way. Your VerveKit account and credits work on all of them — one key, one balance.

Call it as a REST APIOne HTTPS endpoint and an x-api-key header, with SDKs for Node, Python and .NET.APIVerve →Reference →
Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheets →Reference →
Ground an agent on itA cited, machine-checkable fact your model can't produce on its own.VerveContext →Reference →

More in Reference Data:

Was this page helpful?