Color Mixer - Blend & Mix Two Colors Online
Mix and blend two or more colors in customizable percentage ratios using RGB additive light or subtractive pigment blending.
Color Mixer
Mix and blend two or more colors in customizable percentage ratios using RGB additive light or...
- HEX for web/CSS (example: #FF0000)
- RGB for digital screens (0–255 per channel)
- HSL for hue/saturation/lightness adjustments
About Color Mixer
What is a Color Mixer & How Does It Work?
A Color Mixer blends two or more color inputs according to custom mathematical percentage weights. In UI/UX design, game engine rendering, digital illustration, and traditional oil painting, calculating smooth intermediate color transitions allows artists to build balanced gradients, hover states, and atmospheric lighting.
The Mathematics of Color Interpolation (Lerp)
The standard algorithm for blending two colors ($C_1$ and $C_2$) using a blending ratio factor ($t \in [0.0, 1.0]$) is Linear Interpolation (Lerp) across each discrete color channel:
$$R_{\text{blend}} = \text{round}\left( (1 - t) \times R_1 + t \times R_2 \right)$$
$$G_{\text{blend}} = \text{round}\left( (1 - t) \times G_1 + t \times G_2 \right)$$
$$B_{\text{blend}} = \text{round}\left( (1 - t) \times B_1 + t \times B_2 \right)$$
(Where $t = 0.50$ represents a perfect 50/50 balance).
---
Real-World Worked Examples
Example 1: 50/50 Blend of Pure Red and Pure Blue
- Color 1 (Pure Red): `#FF0000` $\rightarrow \text{rgb}(255, 0, 0)$
- Color 2 (Pure Blue): `#0000FF` $\rightarrow \text{rgb}(0, 0, 255)$
- Red Channel: $(0.5 \times 255) + (0.5 \times 0) = \mathbf{128}$
- Green Channel: $(0.5 \times 0) + (0.5 \times 0) = \mathbf{0}$
- Blue Channel: $(0.5 \times 0) + (0.5 \times 255) = \mathbf{128}$
- Resulting Blended Midpoint: `rgb(128, 0, 128)` / `#800080` (Classic Purple)
Example 2: 70/30 Blend of Navy Blue and Sun Yellow
- Color 1 (70%): `#003366` $\rightarrow \text{rgb}(0, 51, 102)$
- Color 2 (30%): `#FFCC00` $\rightarrow \text{rgb}(255, 204, 0)$
- Red: $(0.70 \times 0) + (0.30 \times 255) = 0 + 76.5 = \mathbf{77}$
- Green: $(0.70 \times 51) + (0.30 \times 204) = 35.7 + 61.2 = \mathbf{97}$
- Blue: $(0.70 \times 102) + (0.30 \times 0) = 71.4 + 0 = \mathbf{71}$
- Resulting Color: `rgb(77, 97, 71)` / `#4D6147` (Muted Sage Olive)
---
Step-by-Step Guide: How to Blend Colors
- Choose Color 1 and Color 2: Pick colors using the hex inputs or visual pickers.
- Adjust the Mix Ratio Slider: Slide from 0% (pure Color 1) to 100% (pure Color 2).
- Select Number of Transition Steps: Generate 5, 10, or 20 intermediate palette swatches.
- Copy CSS Snippets: Click any swatch to copy its HEX or CSS `color-mix()` property.
- Explore Related Tools: Pair with our Gradient Generator and Color Palette.
---
Color Harmony, Subtractive vs. Additive Models & UI Blending
Mixing colors digitally requires choosing the appropriate mathematical blending mode to avoid dull, muddy intermediate tones:
- Additive vs. Subtractive Mixing: Computer screens emit light using additive RGB mixing, where combining all primary channels yields pure white (`#ffffff`). Physical paints and printing inks use subtractive CMYK mixing, where combining pigments absorbs light and produces black/dark brown. Our digital color mixer simulates linear light interpolation for crisp web gradients.
- Perceptual Color Spaces (OKLab & Lab): Standard linear RGB interpolation often creates greyish, desaturated "dead zones" when mixing opposing hues (like blue and yellow). Modern UI designers interpolate colors through perceptual color spaces like CIE Lab or OKLab, which preserve perceived chroma and brightness across color transitions.
- Color Token Weighting: Design systems frequently blend 90% of a base neutral grey with 10% of a primary brand color to generate subtle, harmonious tinted card backgrounds and border strokes that feel organically tied to the brand aesthetic.
Digital Design Best Practices
- WCAG Accessibility Verification: Ensure that any dynamically generated blend steps used for interactive button states (hover, focus, active) retain adequate contrast against container surfaces.
- CSS `color-mix()` Integration: Modern browsers support native CSS `color-mix(in srgb, #2563eb 70%, #10b981 30%)`.
- Related Tools: See our Gradient Generator, Color Palette Generator, and Color Picker.
Perceptual Uniformity with OKLab & LCH
Linear RGB color interpolation often creates muddy, desaturated greyish tones when mixing complementary colors like blue and yellow. Modern CSS Color Module Level 4 introduces the `color-mix()` function in `oklab` color space, which maintains perceptual brightness and chroma throughout the blend, producing vibrant, natural gradients.
Color Gamut Clipping & Out-of-Gamut Warnings
When mixing vibrant, highly saturated primary colors in standard sRGB color space, linear mathematical interpolation can generate coordinates exceeding 255 or falling below 0. Clipping these values artificially can alter hue balance. Normalizing color vectors ensures smooth, artifact-free tonal transitions.
Why Mix Colors with ToolSpark?
Blend colors in precise percentage increments from 0% (Color 1) to 100% (Color 2).
Supports linear RGB, sRGB gamma-corrected, and LAB/LCH perceptual color blending.
Generates 5, 10, or 20-step gradient swatch transition stops between your two base colors.
Exports blended midpoints in HEX, RGB, HSL, and CSS color-mix() functional syntax.
Your palette blends are calculated locally in your browser with zero data storage.