ColorUI

App · Images & Design · 6 actions

Color tools from ColorUI's free public API: convert any CSS color into HEX, RGB, HSL, LCH, OKLCH and LAB at once, check the WCAG 2.1 contrast ratio between a text color and a background with AA and AAA pass or fail flags, and generate palettes from a few words about a brand or a mood, from a harmony rule around a base color, or at random. Every palette comes back as hex codes with a link to it on colorui.io, so a workflow can turn a brief into swatches, check a color pair before it ships, or convert a designer's OKLCH into the RGB a legacy tool needs. No account or API key required.

Actions

ActionWhat it does
Check contrastCompute the WCAG 2.1 contrast ratio between a text color and a background, with pass or fail flags for AA and AAA at normal and large text sizes and for graphics.
Check service statusCheck whether ColorUI is answering, how quickly, and how much of the rate limit is left this minute.
Convert a colorConvert any CSS color into HEX, RGB, HSL, LCH, OKLCH and LAB, all at once or one at a time, each with its components and a CSS string ready to paste.
Generate a harmony paletteBuild a palette around one color by a color-wheel rule: complementary, analogous, triadic, tetradic, split-complementary, square or monochromatic.
Generate a palette from a promptGenerate a five-color palette from a few words about what it is for, such as a brand, a product or a mood.
Generate a random paletteDraw a palette of two to eight colors at random, as hex codes with a link to the palette on colorui.io.

Check contrast

Compute the WCAG 2.1 contrast ratio between a text color and a background, with pass or fail flags for AA and AAA at normal and large text sizes and for graphics. The step to run before a color pair ships, with one boolean to branch on. No API key required.

Inputs

Text colorforegroundtextRequired
The color of the text, icon or foreground. Any CSS color works: a hex code such as #7c5cff (bare digits are fine, the # is added), rgb(), hsl(), oklch(), or a named color such as tomato. Any transparency is dropped.
Background colorbackgroundtextRequired
The color behind it. Any CSS color works: a hex code such as #7c5cff (bare digits are fine, the # is added), rgb(), hsl(), oklch(), or a named color such as tomato. Any transparency is dropped.

Outputs

aaobject
Whether the pair meets WCAG 2.1 level AA.
aaaobject
Whether the pair meets WCAG 2.1 level AAA.
backgroundtext
The background color that was checked, as the service echoed it.
foregroundtext
The text color that was checked, as the service echoed it.
gradetext
The best level the pair reaches, as the service grades it: AAA, AA, AA Large (only large text passes), or Fail.
passes_aatrue/false
True when body text passes AA. This is the field to branch on before shipping a text and background pair.
passes_aaatrue/false
True when body text passes AAA, the stricter level.
rationumber
The WCAG 2.1 contrast ratio, from 1 (no contrast) to 21 (black on white), to two decimals.
Example output
{
  "aa": {
    "graphics": true,
    "large_text": true,
    "normal_text": false
  },
  "aaa": {
    "large_text": false,
    "normal_text": false
  },
  "background": "#7c5cff",
  "foreground": "#ffffff",
  "grade": "AA Large",
  "passes_aa": false,
  "passes_aaa": false,
  "ratio": 4.35
}

Check service status

Check whether ColorUI is answering, how quickly, and how much of the rate limit is left this minute. This is the one action that reports a problem as a value instead of failing the step, so a workflow can branch on it, pace itself, or fall back to a saved palette when the service is down. Being throttled is reported separately from being down. No API key required.

Inputs

None.

Outputs

messagetext
What happened, in a sentence worth posting.
onlinetrue/false
True when the service answered with a converted color. This is the field to branch on.
rate_limit_resets_attext
When the current minute's budget refills, as a UTC time like 2026-09-11T14:05:00Z, or null when the service did not say.
rate_limitedtrue/false
True when the answer was a throttle (HTTP 429). Being throttled is not the same as being down.
reachabletrue/false
True when something answered at all, even with an error. False means the request never landed.
requests_remainingnumber
How many requests are left in the current minute, out of 60 per IP address, or null when the service did not say. A workflow can wait when this runs low.
response_time_msnumber
How long the request took, in milliseconds, or null when nothing came back.
status_codenumber
The HTTP status that came back, or null when nothing did.
Example output
{
  "message": "ColorUI is up and converting colors, with 59 of 60 requests left in this minute.",
  "online": true,
  "rate_limit_resets_at": "2026-09-11T14:05:00Z",
  "rate_limited": false,
  "reachable": true,
  "requests_remaining": 59,
  "response_time_ms": 38.4,
  "status_code": 200
}

Convert a color

Convert any CSS color into HEX, RGB, HSL, LCH, OKLCH and LAB, all at once or one at a time, each with its components and a CSS string ready to paste. All at once also gives HSV, the color's luminance and whether it is light or dark. The step that turns a designer's oklch() into the rgb() a legacy tool needs, or a named color into its hex for a template. No API key required.

Inputs

ColorcolortextRequired
The color to convert. Any CSS color works: a hex code such as #7c5cff (bare digits are fine, the # is added), rgb(), hsl(), oklch(), or a named color such as tomato. Any transparency is dropped.
Formatformattext
Optional. Which format to convert into. Every format at once by default, which is the choice for a step that will need more than one.One of: all (All formats), hex, rgb, hsl, lch, oklch, lab. Default: all.

Outputs

csstext
The one string to paste: the CSS of the format asked for, or the hex when every format was.
formattext
The format that was asked for: all, hex, rgb, hsl, lch, oklch or lab.
hextext
The color as lowercase hex, e.g. #7c5cff. Null when a different single format was asked for.
hslobject
The color in HSL, with its components and a CSS string. Null when this format was not asked for.
hsvobject
The color in HSV (hue, saturation and value), the model most color pickers use. CSS has no hsv(), so it comes as numbers alone. Null unless every format was asked for.
inputtext
The color as it was given, echoed back by the service.
is_lighttrue/false
True when ColorUI counts the color as light, so dark text reads best on it; false when it is dark. Null unless every format was asked for.
labobject
The color in LAB, with its components and a CSS string. Null when this format was not asked for.
lchobject
The color in LCH, with its components and a CSS string. Null when this format was not asked for.
luminancenumber
The color's relative luminance, from 0 (black) to 1 (white): the figure WCAG contrast is worked out from. Null unless every format was asked for.
oklchobject
The color in OKLCH, with its components and a CSS string. Null when this format was not asked for.
rgbobject
The color in RGB, with its components and a CSS string. Null when this format was not asked for.
Example output
{
  "css": "#7c5cff",
  "format": "all",
  "hex": "#7c5cff",
  "hsl": {
    "css": "hsl(251.8, 100%, 68%)",
    "h": 251.8,
    "l": 68,
    "s": 100
  },
  "hsv": {
    "h": 251.8,
    "s": 63.9,
    "v": 100
  },
  "input": "#7c5cff",
  "is_light": false,
  "lab": {
    "a": 44.54,
    "b": -78.38,
    "css": "lab(49.76% 44.54 -78.38)",
    "l": 49.76
  },
  "lch": {
    "c": 90.15,
    "css": "lch(49.76% 90.15 299.61)",
    "h": 299.61,
    "l": 49.76
  },
  "luminance": 0.1916,
  "oklch": {
    "c": 0.2299,
    "css": "oklch(59.9% 0.2299 286.2)",
    "h": 286.2,
    "l": 0.599
  },
  "rgb": {
    "b": 255,
    "css": "rgb(124, 92, 255)",
    "g": 92,
    "r": 124
  }
}

Generate a harmony palette

Build a palette around one color by a color-wheel rule: complementary, analogous, triadic, tetradic, split-complementary, square or monochromatic. The step that turns a brand color into a set of accents that sit well with it, as hex codes with a link to the palette. No API key required.

Inputs

Base colorbasetextRequired
The color to build the palette around. Any CSS color works: a hex code such as #7c5cff (bare digits are fine, the # is added), rgb(), hsl(), oklch(), or a named color such as tomato. Any transparency is dropped.
HarmonyharmonytextRequired
The color-wheel rule that picks the other colors from the base: complementary for its opposite, analogous for its neighbors, triadic or square for evenly spaced accents, monochromatic for shades of the base itself.One of: complementary, analogous, triadic, tetradic, split-complementary, square, monochromatic.

Outputs

basetext
The color the palette was built around.
colorslist
The palette, as lowercase hex codes in the service's order, e.g. #7c5cff.
countnumber
How many colors are in the palette.
harmonytext
The harmony rule the palette follows.
share_urltext
A link that opens the palette on colorui.io, e.g. https://colorui.io/p/0b0b1a7c5cffff2bd606f5fffbbf24. Null when the service gave none.
sourcetext
How the palette was made, as the service reports it: ai for a prompt, harmony for a rule, random for a draw.
Example output
{
  "base": "#7c5cff",
  "colors": [
    "#7c5cff",
    "#ff7c5c",
    "#5cff7c"
  ],
  "count": 3,
  "harmony": "triadic",
  "share_url": "https://colorui.io/p/7c5cffff7c5c5cff7c",
  "source": "harmony"
}

Generate a palette from a prompt

Generate a five-color palette from a few words about what it is for, such as a brand, a product or a mood. Comes back as hex codes with the intent the service read into the prompt, the role each color plays (background, surface, primary, accent, support) with why, and a link to the palette on colorui.io. The same prompt and variant always give the same palette. No API key required.

Inputs

PromptprompttextRequired
What the palette is for, in a few words: a brand, a mood, a product. The service reads the intent and designs a palette to suit it.
Variantvariantnumber
Optional. A number from 0 to 99 that picks one of the palettes the prompt could give; left empty, the service uses 0. The same prompt and variant always return the same palette, so change it to get a different take on the same brief.From 0 to 99.

Outputs

colorslist
The palette, as lowercase hex codes in the service's order, e.g. #7c5cff.
countnumber
How many colors are in the palette.
intentobject
What the service took the prompt to be asking for. Null when it gave no reading.
narrativeslist
One explanation per color, in palette order. Empty when the service gave none.
prompttext
The brief the palette was designed for.
rolesobject
The palette's color for each role, as hex, so a step can take the primary color straight from roles.primary. A role the palette doesn't fill is null.
share_urltext
A link that opens the palette on colorui.io, e.g. https://colorui.io/p/0b0b1a7c5cffff2bd606f5fffbbf24. Null when the service gave none.
sourcetext
How the palette was made, as the service reports it: ai for a prompt, harmony for a rule, random for a draw.
variantnumber
The variant that was used, 0 to 99; 0 when none was given. The same prompt and variant always give the same palette.
Example output
{
  "colors": [
    "#e2da42",
    "#dcacde",
    "#da42e2",
    "#928d36",
    "#42e2da"
  ],
  "count": 5,
  "intent": {
    "key": "gaming",
    "label": "Gaming / Esports",
    "rationale": "High-chroma neon cyan, magenta and violet against deep backgrounds nail the gaming aesthetic."
  },
  "narratives": [
    {
      "color": "#e2da42",
      "family": "yellow",
      "role": "accent",
      "summary": "Bright yellow - electric and attention-grabbing.",
      "temperature": "warm",
      "text": "Accent role: this bright yellow pulls the eye to the most important moment.",
      "weight": "bright"
    },
    {
      "color": "#dcacde",
      "family": "magenta",
      "role": "background",
      "summary": "Bright magenta - expressive and romantic.",
      "temperature": "warm",
      "text": "Background role: this bright magenta sets the canvas mood.",
      "weight": "bright"
    },
    {
      "color": "#da42e2",
      "family": "magenta",
      "role": "support",
      "summary": "Bright magenta - electric and confident.",
      "temperature": "warm",
      "text": "Support role: this bright magenta fills the supporting roles - secondary buttons, badges.",
      "weight": "bright"
    },
    {
      "color": "#928d36",
      "family": "yellow",
      "role": "primary",
      "summary": "Mid-tone yellow - cheerful and optimistic.",
      "temperature": "warm",
      "text": "Primary role: this mid-tone yellow carries the brand and primary actions.",
      "weight": "mid-tone"
    },
    {
      "color": "#42e2da",
      "family": "teal",
      "role": "surface",
      "summary": "Bright teal - tropical and energetic.",
      "temperature": "cool",
      "text": "Surface role: this bright teal lifts cards and panels off the background.",
      "weight": "bright"
    }
  ],
  "prompt": "Cyberpunk gaming UI",
  "roles": {
    "accent": "#e2da42",
    "background": "#dcacde",
    "primary": "#928d36",
    "support": "#da42e2",
    "surface": "#42e2da"
  },
  "share_url": "https://colorui.io/p/e2da42dcacdeda42e2928d3642e2da",
  "source": "ai",
  "variant": 7
}

Generate a random palette

Draw a palette of two to eight colors at random, as hex codes with a link to the palette on colorui.io. The step for a fresh scheme every run: a color of the day, a placeholder theme, or inspiration to pass on to a designer. No API key required.

Inputs

Number of colorscountnumber
Optional. How many colors to draw, between 2 and 8. 5 by default.From 2 to 8. Default: 5.

Outputs

colorslist
The palette, as lowercase hex codes in the service's order, e.g. #7c5cff.
countnumber
How many colors are in the palette.
share_urltext
A link that opens the palette on colorui.io, e.g. https://colorui.io/p/0b0b1a7c5cffff2bd606f5fffbbf24. Null when the service gave none.
sourcetext
How the palette was made, as the service reports it: ai for a prompt, harmony for a rule, random for a draw.
Example output
{
  "colors": [
    "#16cb9e",
    "#8c75d1",
    "#871934",
    "#769616",
    "#31b997"
  ],
  "count": 5,
  "share_url": "https://colorui.io/p/16cb9e8c75d187193476961631b997",
  "source": "random"
}

On this page