Color to CSS Variables
Turn a palette into CSS custom properties, Tailwind tokens or Sass.
Build a duotone pair and get the CSS to apply it.
The code appears here
The Duotone Color Generator builds a two-colour gradient map, shows the ramp between them — which is where duotones go muddy — and emits both the accurate SVG filter and the quick CSS blend-mode version.
Duotone maps an image onto two colours: the shadows take one, the highlights take the other, and everything between is interpolated. It is a gradient map, and it is how a page makes photographs from a dozen different sources look like they belong to one brand.
This builds the pair and shows the full ramp between them, so you can see what the mid-tones will do — which is where duotones go wrong. Two colours that look good side by side can produce a muddy middle, and the ramp is where that shows up before you apply it to anything.
The output is the code to actually use it. An SVG feComponentTransfer filter, which is the only method that does a true gradient map in a browser, and the simpler CSS blend-mode approach that gets close with far less markup. Presets cover the pairings that are known to work — the high-contrast brand duotones, the subtle two-tone tints — as a starting point rather than a menu.
The mid-tones are where a duotone succeeds or turns to mud, so they are visible before you apply anything.
feComponentTransfer does a true gradient map, which is the only accurate way to do this in a browser.
The blend-mode approach too, for when two lines of CSS are worth more than exactness.
Applied to a sample photograph, because swatches tell you nothing about how a duotone reads.
Pairings that work, as a starting point rather than a menu.
One for the shadows, one for the highlights.
The interpolation between them is where a duotone succeeds or goes muddy.
The effect is applied live to a sample image so you can judge it properly.
An SVG filter for the accurate version, or CSS blend modes for the quick one.
The darker one on the shadows and the lighter one on the highlights, for a duotone that reads as a photograph. Reversing them gives a negative feel, which is a deliberate effect rather than a mistake.
SVG for accuracy — feComponentTransfer performs a real gradient map. Blend modes are two lines of CSS and get close, but they multiply and screen rather than mapping, so the mid-tones drift.
Because the two colours are too close in lightness, or their midpoint is desaturated. Duotones need a clear lightness gap; check the ramp and widen it until the middle stays colourful.
It can. Duotone flattens an image toward one hue, so anything that relied on colour to be legible — a chart, a screenshot, a sign in a photo — may stop being readable. Keep it for decorative imagery.
What people who use the Duotone Color Generator think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the Duotone Color Generator. It takes half a minute and no account.
Write the first reviewTurn a palette into CSS custom properties, Tailwind tokens or Sass.
Generate complementary, analogous and triadic palettes from one colour.
Build radial gradients with full control of shape and position.
All 148 CSS colour names, searchable and sortable.
See your palette as a real interface instead of swatches.
Convert to and from HWB, the hue-whiteness-blackness notation.
Build a moving gradient background with the keyframes included.
Turn one brand colour into a complete, usable UI palette.