Skip to content
UniKit

Two-color mixer

Blend two colors by ratio with 10 real blend formulas from W3C Compositing and Blending Level 1 — normal, add, multiply, screen, overlay, darken, lighten, difference, hard light and soft light. Every mode is computed channel by channel and returns HEX / RGB / HSL plus an A-to-B interpolation strip.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Colors and blending

Accepts #rgb / #rrggbb, rgb() and hsl(). Blend modes follow W3C Compositing and Blending Level 1 §9.1, channel by channel.

Common pairs
50%
11

Blend result

The result comes as HEX / RGB / HSL, and the strip interpolates the same mode from 0% to 100%.

#336699+#FFCC00=#99994D
Result color HEX#99994D
Result color RGBrgb(153, 153, 77)
Result color HSLhsl(60, 33.04%, 45.1%)
Preview strip

Every cell is the same mode at a ratio from 0% to 100%; the last cell is the full blend at 100%.

0% #33669910% #47708A20% #5C7A7A30% #70856B40% #858F5C50% #99994D60% #ADA33D70% #C2AD2E80% #D6B81F90% #EBC20F100% #FFCC00
Plain text result
a=#336699
b=#FFCC00
mode=normal
ratio=50%
result=#99994D
result=rgb(153, 153, 77)
result=hsl(60, 33.04%, 45.1%)
strip 0% = #336699
strip 10% = #47708A
strip 20% = #5C7A7A
strip 30% = #70856B
strip 40% = #858F5C
strip 50% = #99994D
strip 60% = #ADA33D
strip 70% = #C2AD2E
strip 80% = #D6B81F
strip 90% = #EBC20F
strip 100% = #FFCC00

What this tool does

  • Find the hover / active color for a button: dial in the ratio and mode, then paste the resulting HEX into your stylesheet.
  • Check what “two colors stacked” really looks like in a design: multiply, screen, overlay and friends, computed exactly.
  • Produce sample points from A to B: the strip sweeps 0%–100% in the same mode, ready to copy as CSS gradient stops.

Example

Input

A=#336699, B=#FFCC00, mode normal, ratio 50%

Output

#99994D
rgb(153, 153, 77)
hsl(60, 33.04%, 45.1%)

Normal mode mixes linearly by ratio: (51 + 255) / 2 = 153, (102 + 204) / 2 = 153, (153 + 0) / 2 = 76.5 → 77.

Frequently asked questions

Which blend formulas are used?

The blend modes from W3C Compositing and Blending Level 1 §9.1: multiply = A × B, screen = A + B − A × B, overlay = A ≤ 0.5 ? 2AB : 1 − 2(1 − A)(1 − B), hard and soft light branch on whether the source channel exceeds 0.5, and add is min(1, A + B) (linear dodge). Channels are computed in 0–1 and rounded back to 0–255.

What exactly does the ratio change?

It weights the W3C composite Co = (1 − ratio) × A + ratio × B(A, B): 0% returns color A, 100% returns the full blend, and everything in between is a linear transition. The preview strip sweeps the same mode across the ratio, so its last cell always equals the 100% result.

In which color space is the blend computed?

In gamma-encoded sRGB numbers, matching the default behavior of the browser’s mix-blend-mode. There is no linear-light blending and no ICC color management, so results can differ from Photoshop’s linear dodge or linear blending.

Why does adding a color to itself not return the same color?

Additive and screen-like modes are meant to lighten: #7F7F7F with add gives #FEFEFE and with screen #BFBFBF. Only normal, darken and lighten keep an identical pair unchanged.

Where can I use the result?

The result is given as HEX / RGB / HSL and can go straight into CSS; the strip’s stop values work as linear-gradient stops, and the plain-text result can be copied for documentation.

Keywords:color mixerblend modesW3C compositing

Related tools