colors-mcp-server

v2.1.1
@htetoowaiyan/colors-mcp-server Checked 1 day ago Published 22 days ago

MCP server that gives AI agents exact color math, accessibility checks and ready-made palettes — built for small models.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

colors_check Check contrast

Check WCAG 2 contrast for text/background color pairs and say PASS or FAIL for each, with the exact ratio and, for failures, a nearby passing color. Also gives the signed APCA Lc (APCA-W3 0.98G-4g: positive for dark text on light, negative for light on dark). Use whenever you must know if colors are readable or accessible. Handles translucent colors. Pass foreground+background, or pairs for many.

ParameterTypeDescription
backgroundstringBackground color, for a single check. Any CSS color.
basestringColor that translucent backgrounds are composited over. Default "#ffffff".
foregroundstringText color, for a single check. Any CSS color.
levelstringWCAG level. Default "AA".
pairsarraySeveral checks at once: a list of {foreground, background}. Use instead of foreground/background.
sizestring"normal" text (default), "large" text (24px or 18.66px bold and up), or "ui" for non-text parts like borders and icons.

colors_fix Fix contrast

Make a text color readable: returns the closest color (same hue) that reaches the target contrast ratio on the given background. Use after a contrast check fails, or to pick an accessible text color. The background stays fixed. Returns one hex color and its verified ratio.

ParameterTypeDescription
background *stringThe background color it sits on. Any CSS color.
foreground *stringThe text color that is too low in contrast. Any CSS color.
keepHuebooleanKeep the original hue (within 15 degrees) so the color still reads as the same one. Default true.
targetnumberMinimum contrast ratio to reach. 4.5 = WCAG AA text (default), 3 = large text or UI parts, 7 = AAA text.

colors_palette Build a palette

Build a finished color palette with verified accessibility. kind "ramp": an 11-step tonal scale of a color (lightest to darkest, the seed is one step, evenly spaced). kind "theme": light and dark UI tokens (background, surface, surface-raised, text, text-muted, border, primary, on-primary) from a brand color, with every text contrast rule checked. kind "categorical": N clearly different, color-blind-safe colors for charts. kind "diverging": a scale from `color` through a light neutral to `color2`, with symmetric lightness. Returns hex values ready to use.

ParameterTypeDescription
kind *string"ramp" = tonal scale (50..950) of one color; "theme" = light + dark UI tokens from a brand color; "categorical" = a set of clearly different colors for charts or tags; "diverging" = a scale from one c…
backgroundstringCategorical only: the background the colors sit on. Default "#ffffff".
colorstringSeed color. Required for "ramp" and "theme" (the brand color) and for "diverging" (the left end). Ignored for "categorical".
color2string"diverging" only: the color at the right end.
countintegerCategorical only: how many colors. Default 5.
cvdstringCategorical only: color-blindness types the set must survive. Default "all" (protan, deutan, tritan).
stepsintegerRamp: number of steps, default 11 (named 50, 100 ... 950). Diverging: an odd number of steps, default 7.

colors_find Find colors that meet rules

Find colors that satisfy your rules in one call. Combine any of: hue band (or the hue family of a color), chroma range, lightness range, contrast against one or more backgrounds (`against`), and for several colors a minimum lightness gap, hue gap or color difference (optionally color-blind safe). Returns verified hex colors with the most margin, or says which rule cannot be met.

ParameterTypeDescription
againstarrayEvery found color must reach the ratio against each of these colors, for example a light and a dark surface.
chromaMaxnumberMaximum OKLCH chroma.
chromaMinnumberMinimum OKLCH chroma (0 gray, 0.1 muted, 0.2 vivid).
countintegerHow many colors to find. Default 1.
cvdstringSeveral colors: also keep every pair apart (minDeltaE) under this color blindness. "all" covers the three common types. Default "none".
hueMaxnumberOKLCH hue band end, degrees 0-360.
hueMinnumberOKLCH hue band start, degrees 0-360 (red 30, yellow 100, green 145, cyan 200, blue 260, purple 305, pink 350). If hueMin is above hueMax the band wraps through 0.
hueOfstringInstead of hueMin/hueMax: keep the found colors in the hue family of this color (for example the brand color). The band is its OKLCH hue plus or minus hueWithin.
hueWithinnumberDegrees either side of hueOf. Default 20.
lightnessMaxnumberMaximum OKLCH lightness.
lightnessMinnumberMinimum OKLCH lightness, 0 black to 1 white.
minDeltaEnumberSeveral colors: minimum CIEDE2000 difference between every pair. Default 15 when no other pair rule is given.
minHueGapnumberSeveral colors: minimum OKLCH hue difference in degrees between every pair of colorful colors.
minLightnessGapnumberSeveral colors: minimum OKLab lightness difference between every pair (keeps them apart in grayscale).

colors_scrim Smallest overlay for legible text on an image

Text over a photo: find the smallest overlay (scrim) opacity at which the text reaches a contrast ratio on every worst-case region of the image. Painted like CSS, on 8-bit channels. Returns the opacity and the ratio on each region.

ParameterTypeDescription
overlay *stringOverlay (scrim) color, usually black, white or a brand color. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato".
regions *arrayColors of the busiest or worst-case parts of the image behind the text. A list, even for a single color. Any CSS color strings.
text *stringText color that sits on the image. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato".
stepnumberOpacity grid, for example 0.05. Default 0.05.
targetnumberContrast ratio the text must reach on every region. Default 4.5.

colors_audit Audit CSS colors

Scan CSS for color problems and return exact findings: "text-contrast-aa" (color on background below 4.5:1), "nontext-contrast-3" (border-color on background below 3:1) and "near-duplicate-token" (two :root custom-property colors almost identical, ΔE00 under 2). Resolves var(--x) from :root. Use for any stylesheet or design review.

ParameterTypeDescription
css *stringThe CSS text to audit (rules and :root custom properties). Not a file path.

colors_info Describe or validate colors

Validate color strings and describe each: hex, rgb, hsl, oklch, closest CSS name, how light it is, whether it fits sRGB, and contrast against white and black (so you can pick black or white text). Use to check that an input is a real color, or to understand an unfamiliar color. Bad inputs are reported per color, with a suggestion.

ParameterTypeDescription
colors *arrayColors to describe or validate. A list, even for a single color. Any CSS color strings.

colors_convert Convert colors

Convert colors to another format: hex, rgb, hsl, hwb, hsv, oklch, oklab, CSS lab/lch (D50), lab-d65/lch-d65 (CIELAB, D65, no adaptation), xyz (D65), linear (linear sRGB), p3, rec2020 (CSS, 2.4 gamma), rec2020-oetf (BT.2020 transfer) or rec2020-linear. Reads any of them as input. Handles lists. A color outside sRGB (for hex/rgb/hsl/hwb) is mapped in by lowering chroma only, and the result says so.

ParameterTypeDescription
colors *arrayColors to convert. A list, even for a single color. Any CSS color strings.
to *stringTarget format. "lab"/"lch" are the CSS ones (D50); "lab-d65"/"lch-d65" use the D65 white, no adaptation. "xyz" is D65, "linear" is linear sRGB, "p3" is display-p3, "rec2020" has a 2.4 gamma, "rec2020-…
precisionintegerDecimal places. Default 3.

colors_compare Compare colors

Measure how different colors look from a reference: CIEDE2000 (ΔE00, default), CIE94, CIE76 or Oklab distance, or all of them at once. Returns the nearest candidate and a full ranking, closest first. Use for 'which color is closest', 'are these the same color', or matching to a palette. Under 1 is not noticeable; over 10 is very different.

ParameterTypeDescription
candidates *arrayColors to compare against the reference. A list, even for a single color. Any CSS color strings.
color *stringThe reference color. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato".
metricstring"ciede2000" (default, ΔE00), "cie94" (graphic-arts weights, reference chroma), "cie76" (Euclidean in CIELAB), "oklab" (Euclidean in Oklab) or "all" (every metric; ranked by ΔE00). Lab is D65, no ada…

colors_blend Blend or build a gradient

Mix colors or build a gradient between 2+ colors. Returns evenly spaced hex colors with both endpoints included, interpolated in OKLCH so midpoints stay clean (no gray mud). Set `at` for one mixed color (0.5 = even mix). Always in sRGB gamut.

ParameterTypeDescription
colors *arrayThe colors to blend between, in order. 2 to 8 stops. A list, even for a single color. Any CSS color strings.
atnumberReturn just ONE blended color at this position between the first two colors (0 = first, 0.5 = even mix, 1 = second). Overrides steps.
spacestringInterpolation space. "oklch" (default) keeps colors vivid and takes the shorter hue path; "oklab" is smooth but can dull; "srgb" matches old CSS gradients and goes muddy between far-apart hues; "srgb-…
stepsintegerHow many colors to return, endpoints included. Default 5.

colors_adjust Adjust colors

Make colors lighter, darker, more or less colorful, or rotate the hue, by exact OKLCH amounts. Changes only the property you name; the result is always a valid sRGB hex (chroma is lowered if the color would leave the gamut). Examples: {property:"lightness",mode:"add",amount:-0.1}; {property:"hue",mode:"add",amount:40}; {property:"chroma",mode:"multiply",amount:0.6}.

ParameterTypeDescription
amount *numberThe number to add, multiply by, or set. Lightness and chroma are on the OKLCH scale (add -0.1 lightness = a bit darker); hue is in degrees.
colors *arrayColors to adjust. A list, even for a single color. Any CSS color strings.
property *stringWhat to change, in OKLCH: lightness (0 black to 1 white), chroma (colorfulness, about 0 to 0.4), or hue (degrees, 0 to 360).
modestring"add" the amount (negative lowers it), "multiply" by the amount (0.5 halves chroma), or "set" the property to the amount. Default "add".

colors_harmony Color harmony

Generate a color scheme from a base color by rotating its OKLCH hue (complementary, split-complementary, triadic, tetradic, analogous) while keeping lightness and chroma matched. Returns hex colors with their hue offsets; the base is included at offset 0. OKLCH hue steps look even, unlike HSL angles.

ParameterTypeDescription
color *stringThe base color. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato".
scheme *stringColor scheme: complementary (hue offsets 0, 180); split-complementary (hue offsets 0, 150, 210); triadic (hue offsets 0, 120, 240); tetradic (hue offsets 0, 90, 180, 270); analogous (hue offsets -30,…

colors_vision Color blindness simulation

Simulate how colors look with color blindness (Machado 2009 model) and, for 2+ colors, measure whether the set stays distinguishable: returns the weakest pair per vision type. Use to check chart or status colors, or to find out if red/green pairs will collide. To BUILD a color-blind-safe set use colors_palette with kind "categorical".

ParameterTypeDescription
colors *arrayColors to simulate (and compare with each other). A list, even for a single color. Any CSS color strings.
minDifferencenumberA pair counts as distinguishable when its CIEDE2000 difference is at least this. Default 10.
typestringWhich color vision to simulate. "deuteranopia" and "protanopia" are red-green; "tritanopia" is blue-yellow; "achromatopsia" is no color; "all" (default) runs all four.