v1.0 · Browser-onlyYour image never leaves your browser

Drop an image,
paste a :root{}
upload  account  paywall

Drop any image and get a 3–12 color palette with CSS custom properties, Tailwind v3/v4 configs, JSON design tokens, and a WCAG 2.1 contrast-pairings matrix. No upload. No account. No paywall.

Palette LaboratorySPEC. 001

Sample · N=6

Drop an image to extract

SAMPLE · N=6CONTRAST AA: 11/15
EXTRACTOR

Drop an image. Get the palette.

CANVAS API · ZERO UPLOAD
source · canvas

Drop your image here

or browse · JPEG · PNG · WebP · GIF

.jpg.png.webp.gif
Demo palette · 6 colors
06
DEMO · N=6CLIENT-ONLY · NO UPLOAD
export · copy all
:root {
  --color-1: #E8FF3C;
  --color-2: #2F1F9A;
  --color-3: #FF5A36;
  --color-4: #41D6FF;
  --color-5: #C39DFF;
  --color-6: #D5C8A8;
}
format · css · 6 decls
CONTRAST

Every pair, graded.

WCAG 2.1 · AA / AAA
contrast · wcag 2.1
Filter
4 of 15 pairs compliant
10.54AAA

#E8FF3C / #2F1F9A

7.10AAA

#2F1F9A / #D5C8A8

6.89AA

#2F1F9A / #41D6FF

5.38AA

#2F1F9A / #C39DFF

REFERENCE

Color format syntax and export reference

Which color notation, Tailwind config shape, or design-token JSON should a palette land in once it leaves an image? This catalog answers that across hex, rgb(), hsl(), OKLCH and the wide-gamut formats, both Tailwind config generations, and the three competing token JSON shapes — the exact syntax for each, and when to reach for it.

CSS color formats at a glance

FormatSyntax shapeAlphaColor gamutBrowser support
#RGB3-digit hexNosRGBUniversal
#RGBA4-digit hexYessRGBModern (2018+)
#RRGGBB6-digit hexNosRGBUniversal
#RRGGBBAA8-digit hexYessRGBModern (2018+)
rgb() / rgba()functional, comma or spaceYessRGBUniversal
hsl() / hsla()hue-sat-lightnessYessRGBUniversal
hwb()hue-white-blackYessRGBModern (2022+)
lab()L-A-B perceptualYesWide gamutModern (2023+)
lch()L-chroma-hue perceptualYesWide gamutModern (2023+)
oklab()improved LabYesWide gamutModern (2023+)
oklch()improved LCHYesWide gamutModern (2023+)
color()named color spaceYesConfigurableModern (2023+)
color-mix()function mixerYesConfigurableModern (2023+)
currentColorinherited from parentInheritedInheritedUniversal
named (tomato, coral)CSS Color Module L4 keywordNosRGBUniversal

Hex notation forms

Hexroot’s CSS Variables export uses 6-digit uppercase hex (#RRGGBB). The full hex family:

FormPatternEquivalent expansionExample
Short#RGBeach digit doubles#f3c = #ff33cc
Short with alpha#RGBAeach digit doubles, alpha last#f3c8 = #ff33cc88
Long#RRGGBBfull byte per channel#ff33cc
Long with alpha#RRGGBBAAadds alpha byte#ff33cc88

Notes on hex:

  • Short-form digits double rather than concatenate. #abc is #aabbcc, not #0a0b0c.
  • Hex is case-insensitive; Hexroot exports uppercase for diff readability in code review.
  • 8-digit alpha hex is in every modern engine, but older Sass releases (pre-1.10) and pre-3.3 Tailwind strip the alpha byte during parsing.

RGB syntax

CSS Color Module Level 4 accepts two valid syntaxes that coexist in the modern parser:

CSS
/* Legacy comma syntax */
color: rgb(255, 51, 204);
color: rgba(255, 51, 204, 0.5);

/* Modern space-separated with slash for alpha */
color: rgb(255 51 204);
color: rgb(255 51 204 / 0.5);

/* Modern percentage forms */
color: rgb(100% 20% 80%);
color: rgb(100% 20% 80% / 50%);

/* Modern number/percent mixing is disallowed */
color: rgb(255 20% 204);  /* parse error */

rgb() and rgba() are aliases in the modern parser, and both accept either alpha style. Pick one within a codebase.

HSL syntax

CSS
/* Legacy comma syntax */
color: hsl(316, 100%, 60%);
color: hsla(316, 100%, 60%, 0.5);

/* Modern space-separated */
color: hsl(316 100% 60%);
color: hsl(316 100% 60% / 0.5);

/* Hue units (CSS Color L4) */
color: hsl(316deg 100% 60%);
color: hsl(0.878turn 100% 60%);
color: hsl(5.514rad 100% 60%);

Saturation and lightness must be percentages. Hue accepts deg, turn, rad, grad, or unitless (interpreted as deg). HSL is sRGB; for perceptually uniform lightness use OKLCH instead.

OKLCH and wide-gamut formats

OKLCH is the recommended modern format for design-system tokens. Perceptually uniform lightness means a 50% L value reads as the same brightness across hues, which makes generating tint/shade scales mathematically clean.

CSS
/* OKLCH: L 0-1 or 0-100%, C 0-0.4+, H 0-360 */
color: oklch(0.7 0.18 316);
color: oklch(70% 0.18 316deg / 50%);

/* OKLAB: L 0-1 or 0-100%, a/b roughly -0.4 to 0.4 */
color: oklab(0.7 0.16 -0.09);

/* LAB / LCH: D50 reference, broader ranges */
color: lab(60 70 -40);
color: lch(60 80 316);

/* Display-P3 wide-gamut explicit */
color: color(display-p3 1 0.2 0.8);

/* color-mix interpolates in any color space */
color: color-mix(in oklch, #6ba8e8 60%, #e8c56b);

Generating tints in HSL: stepping L from 60 to 70 around yellow looks darker than the same step around blue. Generating tints in OKLCH: the steps are visually equal across hue.

Tailwind v3 color config

Hexroot’s Tailwind v3 export targets tailwind.config.js. The full shape it supports:

JavaScript
// tailwind.config.js (v3)
module.exports = {
  theme: {
    extend: {
      colors: {
        // Flat single-value token
        'palette-1': '#6BA8E8',

        // Nested scale (palette-50 through palette-900)
        brand: {
          50:  '#f0f6fc',
          100: '#dbe9f5',
          500: '#3D6FA3',
          900: '#0e2a44',
          DEFAULT: '#3D6FA3', // accessible as `bg-brand`
        },

        // CSS variable reference (runtime theming)
        accent: 'rgb(var(--accent-rgb) / <alpha-value>)',
      },
    },
  },
};

The <alpha-value> placeholder lets bg-accent/50 interpolate alpha at runtime. It requires the CSS variable to hold the bare space-separated RGB triple (--accent-rgb: 255 51 204), not the full rgb() call.

Tailwind v4 @theme syntax

Tailwind v4 collapses the JS config into CSS. The @theme block declares custom properties that compile into utility classes:

CSS
@import "tailwindcss";

@theme {
  /* Single token */
  --color-palette-1: #6BA8E8;

  /* Scale: --color-{name}-{step} generates bg-name-step utilities */
  --color-brand-50:  #f0f6fc;
  --color-brand-500: #3D6FA3;
  --color-brand-900: #0e2a44;

  /* OKLCH source token (recommended for v4) */
  --color-accent: oklch(0.65 0.22 28);

  /* Non-color tokens use other prefixes */
  --font-display: "Fraunces", serif;
  --radius-card: 4px;
}

What changed from v3:

  • No JS config required; tokens live in CSS.
  • All color tokens use --color- prefix. The suffix becomes the utility name, so --color-palette-1 produces bg-palette-1, text-palette-1, border-palette-1.
  • The <alpha-value> placeholder is gone. Alpha goes through color-mix() automatically when a utility includes /N.
  • Custom properties cascade into media queries, so dark-mode overrides work natively without a dark: prefix on every utility.

Design-token JSON formats

Hexroot’s JSON export emits a flat enriched shape. The wider design-token ecosystem has three competing shapes worth knowing before choosing where to paste a palette.

Hexroot enriched flat shape (Style Dictionary compatible with a transform):

JSON
{
  "color-1": {
    "hex": "#6BA8E8",
    "rgb": { "r": 107, "g": 168, "b": 232 },
    "hsl": { "h": 211, "s": 73, "l": 66 }
  }
}

W3C Design Tokens Community Group (DTCG, draft):

JSON
{
  "color": {
    "primary": {
      "$type": "color",
      "$value": "#6BA8E8"
    }
  }
}

Tokens Studio (Figma plugin):

JSON
{
  "global": {
    "color": {
      "primary": {
        "value": "#6BA8E8",
        "type": "color"
      }
    }
  }
}

Style Dictionary v3:

JSON
{
  "color": {
    "primary": {
      "value": "#6BA8E8",
      "comment": "Brand primary"
    }
  }
}

Pick a shape early. Tooling assumes one, and converters between shapes are lossy: DTCG’s $value can hold a reference like {color.primary} that Style Dictionary v3’s value resolves at build time, while Tokens Studio’s nested value/type keys disagree with DTCG’s $value/$type keys on every level.

Common-failure patterns

SymptomCauseFix
bg-accent/50 produces solid color, not 50% opacityCSS variable holds full rgb(...) call instead of bare tripleStore as --accent-rgb: 255 51 204, reference as rgb(var(--accent-rgb) / <alpha-value>)
8-digit hex #ff33cc88 renders opaque in compiled CSSSass < 1.10 strips alpha byte during parsingUpgrade Sass or pre-convert to rgba() before the value enters Sass
OKLCH colors render flat or wrong in older SafariEngine fallback to sRGB clipping below 16.4Pair with a color(display-p3 ...) declaration so modern browsers pick the wide-gamut value
color-mix() returns transparent blackOne operand is unparseable (typo, missing percent unit)Validate both colors compile standalone before passing them to color-mix
Tailwind v4 bg-palette-1 class doesn't existToken named --palette-1 instead of --color-palette-1All Tailwind v4 color tokens require the --color- prefix; the suffix becomes the utility
Design-token JSON imports as [object Object] in FigmaTokens Studio expects flat value field, not nested hex/rgb/hslUse the Tokens Studio or W3C shape when importing to Figma; keep Hexroot's enriched shape for build pipelines
WCAG ratio reports 1.00 for two distinct colorsBoth hex values are mistyped to the same string (case mismatch)Recompute with uppercase normalized hex; both Hexroot and the WCAG formula are case-insensitive but copy errors aren't

Related concepts

  • sRGB vs Display-P3 gamut. oklch() and color() notations open up the wider P3 gamut available on modern hardware; sRGB-only formats clip values outside the cube.
  • Relative luminance. The WCAG 2.1 contrast formula weights G channel highest (0.7152), then R (0.2126), then B (0.0722); luminance is the input to the pairwise contrast ratio.
  • CIE Lab color space. Perceptually uniform reference space designed in 1976; OKLab is a 2020 refinement that better predicts blue-region perception and is the basis for OKLCH.
  • Tokens Studio plugin. Figma plugin for design-token management; uses its own JSON shape and supports value references via {group.subgroup.name} notation at build time.
  • Design Tokens Community Group (DTCG). W3C draft standardizing token shape; uses $value, $type, $description prefixed keys for forward compatibility with future versions.