Color Calculator
Mix colors, blend with different modes, and perform color operations. View results in HEX, RGB, and HSL.
Select Colors
Result
HEX
#269EBC
RGB
38, 158, 188
HSL
192, 66%, 44%
Color Gradient
Tip: Click on any color swatch or value to copy it to your clipboard.
What Is Color Mixing and Why Does It Matter?
Color mixing is the process of combining two or more colors to produce a new one. In digital design, this happens mathematically by manipulating the red, green, and blue (RGB) channel values of each color. Unlike physical pigment mixing — where combining blue and yellow paint produces green — digital color mixing follows precise arithmetic rules that yield perfectly reproducible results every time.
This color calculator supports six blend operations: Mix, Add, Subtract, Multiply, Screen, and Overlay. Each operation is rooted in the same foundational principle: take two RGB triplets, apply a per-channel formula, clamp the output to the valid 0–255 range, and convert the result back to HEX, RGB, and HSL for easy use in code, design tools, or print workflows.
Understanding color operations is essential for web developers choosing CSS blend modes, graphic designers crafting layer effects in image editors, and UI designers maintaining a coherent color palette. When you know exactly what mathematical transformation a "Screen" or "Multiply" blend applies, you can predict the output before touching a tool — and reverse-engineer any color effect you admire on screen.
The calculator also generates an 11-step gradient between the two chosen colors, using linear interpolation. This gradient is invaluable for building accessible color scales, hover-state transitions, data-visualization palettes, and design-system tokens where consistent perceptual steps between shades are required.
Results are shown in three standard formats simultaneously: HEX (used in HTML, CSS, and most design software), RGB (the native web format and the basis of all calculations here), and HSL (hue, saturation, lightness — a human-friendly model that makes it easy to adjust the perceived brightness or vividness of a color without changing its hue). Click any value to copy it directly to your clipboard.
The RGB Color Model Explained
RGB stands for Red, Green, Blue — the three additive primary colors of light. Every color on a digital screen is expressed as a combination of these three channels, each ranging from 0 (none) to 255 (full intensity). When all three channels are 0, the result is black; when all are 255, the result is pure white.
The HEX color format is simply the RGB triplet written in hexadecimal. For example, #3B82F6 decodes to R = 0x3B = 59, G = 0x82 = 130, B = 0xF6 = 246. The color calculator performs all arithmetic in the RGB domain, making the math transparent and exact.
Converting between RGB and HSL requires a bit more work. Given normalized RGB values (each divided by 255), the lightness is the average of the maximum and minimum channel values: L = (max + min) / 2. Saturation depends on whether the lightness is above or below 0.5, and hue is derived from which channel is dominant and the ratio of the remaining channels. The calculator shows the HSL values so you can immediately judge how light or saturated the result color will appear without doing any extra arithmetic yourself.
Knowing the RGB model matters because every blend operation in this tool works channel-by-channel. The red channel of Color 1 is blended with the red channel of Color 2, independently of green and blue. This channel-independence is what makes the math predictable and composable across all six operations.
Blend Mode Formulas: How Each Operation Works
Each blend mode produces a different visual character, and understanding the formula explains exactly why.
Mix is a weighted average. At ratio = 50, each color contributes equally and the result is a true midpoint hue. Slide the ratio toward 100 to lean toward Color 1, or toward 0 to lean toward Color 2. Because the formula is a convex combination, the result is always between the two inputs — no clipping occurs.
Add sums the channel values and caps at 255. Adding two bright colors often produces white or near-white because multiple channels hit the ceiling. Adding a dark color to any other color brightens it proportionally. This mode is identical to the "Linear Dodge (Add)" layer mode in Photoshop and Figma.
Subtract removes the second color's light from the first, clamped at zero. It tends to darken and can introduce unexpected hue shifts when one channel reaches zero before others. Subtracting a color from itself produces black (0, 0, 0).
Multiply scales each channel by the other, normalized to the 0–255 range: C1 × C2 / 255. Because both values are at most 255, the product divided by 255 is always ≤ the smaller of the two inputs. Multiplying any color by black (var(--foreground)000) gives black; multiplying by white (var(--card-bg)FFF) leaves the original unchanged. Multiply always darkens or preserves.
Screen is the inverse of Multiply: it inverts both inputs, multiplies, normalizes, then inverts the result. Screen always brightens or preserves, and multiplying two screens together is never darker than either input. Screening with white (var(--card-bg)FFF) always yields white; screening with black leaves the original unchanged.
Overlay combines Multiply and Screen depending on the base value. When Color 1's channel is below 128, Multiply is applied; above 128, Screen is applied. This boosts contrast — darks get darker, lights get lighter — while preserving mid-tones. Overlay is the workhorse of contrast-enhancing layer effects in professional design tools.
| Mode | Effect on Brightness | Identity Color |
|---|---|---|
| Mix | Neutral (depends on ratio) | N/A (ratio-dependent) |
| Add | Always brightens or holds | Black (var(--foreground)000) |
| Subtract | Always darkens or holds | Black (var(--foreground)000) |
| Multiply | Always darkens or holds | White (var(--card-bg)FFF) |
| Screen | Always brightens or holds | Black (var(--foreground)000) |
| Overlay | Increases contrast | 50% gray (#808080) |
Color Blend Operations (applied per R, G, B channel)
Where:
- C1= Channel value (R, G, or B) of Color 1 (0–255)
- C2= Channel value (R, G, or B) of Color 2 (0–255)
- ratio= Mix ratio slider value (0–100); percentage of Color 1 in the output
- result= Output channel value, clamped to 0–255 and rounded to the nearest integer
Linear Color Gradient Interpolation
The gradient panel at the bottom of the calculator shows 11 evenly spaced color stops between Color 1 and Color 2, computed by linear interpolation. For each step index i from 0 to 10, the interpolation parameter is t = i / 10, and each channel is blended as:
gradient[ch] = C1[ch] × (1 − t) + C2[ch] × t
At t = 0 the result equals Color 1 exactly; at t = 1 it equals Color 2 exactly. The intermediate stops are mathematically uniform steps in RGB space. While RGB linear interpolation is computationally simple and widely understood, it can sometimes produce desaturated mid-tones when the two hues are complementary (e.g., red and cyan), because their RGB midpoints happen to be near gray. For most adjacent-hue combinations — blues to greens, oranges to yellows — RGB interpolation produces natural-looking gradients that translate directly into CSS linear-gradient color stops.
Each gradient swatch is clickable: clicking copies that stop's HEX value to the clipboard so you can paste it directly into a CSS file, design token sheet, or Figma style. This workflow is faster than manually computing intermediate hex values or reaching for a separate gradient tool.
Practical Design Applications for Color Operations
Color blending operations appear throughout professional digital design workflows, often under different names. CSS exposes the same operations through the mix-blend-mode and background-blend-mode properties; image editors expose them as layer blend modes. When you understand the math, translating results from this calculator directly to production code or design files becomes straightforward.
Brand palette generation: Use the Mix operation with varying ratios (20%, 40%, 60%, 80%) to produce a full tint-and-shade scale from a single brand color. This is the same technique used by Tailwind CSS and Material Design to derive the 50–950 scale from a base 500-level color.
Texture overlays: The Multiply mode is the standard choice for darkening a photographic background with a semi-opaque color wash. Because Multiply always darkens, a warm brown multiplied over a photo will tint the highlights amber while keeping shadows deep — the classic "vintage photo" effect.
Glow and bloom effects: Screen mode is ideal for adding light effects over dark backgrounds. Particle systems, lens flares, and neon signs in UI design all exploit the Screen formula's property of never darkening, allowing bright overlays to accumulate to white without harsh clipping artifacts.
Contrast enhancement: Overlay mode doubles as a contrast filter. Overlaying a 50% gray (#808080) leaves the base image unchanged (it is the identity for Overlay). Overlaying with a lighter gray boosts contrast toward the highlights, while a darker gray boosts toward the shadows.
Data visualization palettes: The gradient panel gives you a ready-made sequential color scale between two anchor colors. Copy the 11 stops into a palette definition for a chart library, a choropleth map, or a heat-map visualization where value magnitude maps to color intensity.
Understanding HEX, RGB, and HSL Color Formats
The calculator shows the result color in all three major CSS color formats so you can choose whichever suits your workflow without any manual conversion.
HEX is the most compact and most widely supported format. It encodes each of the three RGB channels as a two-digit hexadecimal number (00–FF), concatenated into a six-character string prefixed with #. HEX is the default format in CSS, SVG, and most design tool color pickers. It contains no explicit alpha (opacity) channel; for opacity you need the eight-character HEX8 or var(--card-bg) notation.
RGB (rgb(R, G, B)) is the native format of screens and browsers. It expresses each channel as a decimal integer 0–255. RGB is especially useful when you need to manipulate channels programmatically in JavaScript, apply CSS filters, or interface with canvas-based drawing code where channel values are read and written individually.
HSL (hsl(H, S%, L%)) represents color as Hue (0–360°, the color wheel angle), Saturation (0–100%, how vivid the color is), and Lightness (0–100%, ranging from black through the pure hue to white). HSL is the most human-friendly model for design work: to make a color lighter, increase L; to desaturate it, decrease S; to shift the hue, rotate H. Many design systems store base colors as HSL tokens precisely because the parameters map directly to designer intent.
Worked Examples
Mix Blue and Green at 50% Ratio
Problem:
What color results from mixing #3B82F6 (blue, RGB 59, 130, 246) and #10B981 (green, RGB 16, 185, 129) at a 50/50 ratio?
Solution Steps:
- 1Convert to RGB: Color 1 = (59, 130, 246); Color 2 = (16, 185, 129). Ratio = 50, so r1 = 0.50, r2 = 0.50.
- 2Apply mix formula per channel — R: 59 × 0.50 + 16 × 0.50 = 29.5 + 8.0 = 37.5 → rounds to 38 (0x26). G: 130 × 0.50 + 185 × 0.50 = 65.0 + 92.5 = 157.5 → rounds to 158 (0x9E). B: 246 × 0.50 + 129 × 0.50 = 123.0 + 64.5 = 187.5 → rounds to 188 (0xBC).
- 3Assemble HEX: #269EBC — a teal-cyan color.
- 4Convert to HSL: normalized r = 38/255 ≈ 0.149, g = 158/255 ≈ 0.620, b = 188/255 ≈ 0.737. max = b, min = r. L = (0.737 + 0.149)/2 ≈ 0.443 → 44%. d = 0.737 − 0.149 = 0.588. S = 0.588 / (0.737 + 0.149) ≈ 0.664 → 66%. H ≈ 196°.
- 5Result: HEX #269EBC | RGB (38, 158, 188) | HSL (196°, 66%, 44%).
Result:
#269EBC — a vibrant teal-cyan at RGB (38, 158, 188), HSL ≈ (196°, 66%, 44%).
Add Red and Blue (Color Addition)
Problem:
What does adding pure red #FF0000 (RGB 255, 0, 0) and pure blue var(--foreground)0FF (RGB 0, 0, 255) produce?
Solution Steps:
- 1Color 1 = (255, 0, 0); Color 2 = (0, 0, 255). Operation: Add.
- 2Apply add formula per channel — R: min(255, 255 + 0) = 255. G: min(255, 0 + 0) = 0. B: min(255, 0 + 255) = 255.
- 3Result RGB: (255, 0, 255). HEX: #FF00FF.
- 4This is pure magenta — the additive combination of maximum red and maximum blue with no green, exactly as predicted by additive color theory.
Result:
#FF00FF — pure magenta at RGB (255, 0, 255), HSL (300°, 100%, 50%).
Multiply Blend of Orange and Periwinkle
Problem:
Apply Multiply blend to #FF8040 (RGB 255, 128, 64) and #4080FF (RGB 64, 128, 255). What is the result?
Solution Steps:
- 1Color 1 = (255, 128, 64); Color 2 = (64, 128, 255). Operation: Multiply.
- 2Apply multiply formula — R: (255 × 64) / 255 = 64.0 → 64 (0x40). G: (128 × 128) / 255 = 16384 / 255 ≈ 64.25 → rounds to 64 (0x40). B: (64 × 255) / 255 = 64.0 → 64 (0x40).
- 3All three channels converge to 64, producing a neutral dark gray: RGB (64, 64, 64), HEX #404040.
- 4This illustrates the darkening property of Multiply — complementary-ish color pairs often collapse toward neutral grays or browns when multiplied.
Result:
#404040 — a dark neutral gray at RGB (64, 64, 64), HSL (0°, 0%, 25%).
Screen Blend of Red and Yellow
Problem:
Screen blend #FF0000 (RGB 255, 0, 0) with var(--card-bg)F00 (RGB 255, 255, 0). What color results?
Solution Steps:
- 1Color 1 = (255, 0, 0); Color 2 = (255, 255, 0). Operation: Screen.
- 2Apply screen formula — R: 255 − ((255−255) × (255−255)) / 255 = 255 − 0 = 255. G: 255 − ((255−0) × (255−255)) / 255 = 255 − 0 = 255. B: 255 − ((255−0) × (255−0)) / 255 = 255 − 255 = 0.
- 3Result RGB: (255, 255, 0) — same as Color 2. This makes sense: Color 1 has maximum red. Screen with maximum red in any other color cannot darken that channel below 255.
- 4The result is pure yellow (var(--card-bg)F00) — demonstrating that Screen preserves the brighter value when one input is at maximum.
Result:
var(--card-bg)F00 — pure yellow at RGB (255, 255, 0), HSL (60°, 100%, 50%).
Tips & Best Practices
- ✓Click any result color swatch or value label to instantly copy it — HEX, RGB, or HSL — to your clipboard.
- ✓Use the Mix operation at ratios of 10%, 20%, 30%… 90% to generate a full tint scale from a base brand color for a design system.
- ✓Multiply a photo color with a warm amber (#FFBF00) to simulate a golden-hour filter while keeping shadows dark.
- ✓Screen two complementary colors to find a near-white result — this is useful for verifying that two colors are truly complementary.
- ✓The gradient strip is an instant 11-step color scale. Click each swatch to copy its HEX stop directly into a CSS linear-gradient().
- ✓Overlay with a 50% gray (#808080) always returns the original Color 1 unchanged — use this as a sanity check when debugging layer effects.
- ✓Subtracting a color from itself always yields var(--foreground)000; use Subtract to identify the complementary delta between two palette colors.
- ✓Convert your result to HSL and adjust only the Lightness (L) to create accessible light/dark variants without altering the hue.
- ✓For data-viz palettes, mix two colors at 50% and use the gradient to validate that mid-tones have sufficient contrast against a white background.
Frequently Asked Questions
Sources & References
Last updated: 2026-06-05
Help us improve!
How would you rate the Color Calculator?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: Standard Mathematical References
by Various