Compare three ways to mix red and blue
Admin ·
Two palette endpoints can produce different midpoints depending on the mixing space. Compare the same endpoints and ratio before choosing a blend for a design system.
Mix red and blue in three spaces
Select Signal red and blue and keep Color 2 share at 50%. The sRGB midpoint is #800080. Linear sRGB gives #BC00BC because the blend averages light intensities before converting back to display values.
Select Oklab with the same 50% share to get #8C53A2. Oklab uses a lightness axis and two color axes. Compare the three previews around your intended background before choosing a midpoint.
W3C CSS Color 4 — Oklab and OkLChW3C CSS Color 5 — Mixing colors
Keep the ratio explicit
Return to sRGB and enter 25 in Color 2 share. The result is #BF0040. The first endpoint contributes 75% and the blue endpoint contributes 25%. Enter a share to four decimal places when the eleven blend steps are too coarse.
Copy CSS color-mix to keep the two colors, weights and mixing space in the stylesheet. Copy HEX when you need a single static sRGB value. Static values use eight-bit channels.
Check a half-transparent blend
Select Red to transparent blue at 50%. The output is rgba(255, 0, 0, 0.5), or #FF000080 in hexadecimal. The blue endpoint contributes zero visible color, while the blend's opacity falls to one half.
The functional RGB value keeps the decimal alpha of 0.5. HEX alpha rounds it to 128 out of 255. Compare the copy formats if a project specifies alpha in one notation.
Common questions
What happens when a blended color exceeds sRGB?
The static RGB and HEX formats clip channels to the sRGB range. The copied color-mix() expression lets a supporting browser map the mixed color to its display.
Can I choose a mix between the displayed steps?
Yes. Use Color 2 share or the range control. The displayed steps are shortcuts for multiples of ten percent.
Sources
Put it into practice.
Related guides
- Making an sRGB ramp with tints and shades
- Reading HEX8, HSL, HWB and HSV values
- How to Pick a Color and Get Its HEX or RGB Code
- Compare blue-500 in Tailwind 3 and 4
- Check a Random Wheel’s Winning Sector
- Match a CSS Filter to a Black Icon
- Choose an sRGB Fallback for OKLCH
- Compare Saturation and Chroma Adjustments