GLITCH LAB v1.0 ezolab.dev / lab instrument SYS: READY ✦ Holiday cards

Lab/ Guides/ Technique

Real RGB Split in CSS with mix-blend-mode: screen

How to split text into real red, green and blue light channels with mix-blend-mode: screen, why it vanishes on white (and the CMYK multiply fix), plus live demos.

/#glitch/#rgb/#text

Guide // TechniqueLive demos inside
Contents [8]
  1. The quick answer
  2. How mix-blend-mode: screen adds light
  3. Why RGB split disappears on a white background (and the CMYK fix)
  4. Why isolation: isolate matters
  5. Real RGB split on images and glitch slices
  6. Checklist: why mix-blend-mode is not working
  7. Accessibility
  8. FAQ

Most "RGB split" tutorials in CSS stack a red and cyan text-shadow behind white text. It looks painted on, and when the channels overlap, the colors turn muddy instead of bright. Real optical chromatic aberration splits light: red, green, and blue channels that add back up to pure white when they line up.

In CSS, you get real light addition with one rule: mix-blend-mode: screen. Here is how to build true RGB channel splitting for dark backgrounds, why it disappears on white pages (and the CMYK multiply fix), and the checklist for every time mix-blend-mode refuses to work.

The quick answer

Make the element itself pure green (#0f0), duplicate it into two pseudo-elements in pure red (#f00) and pure blue (#00f), and blend them with mix-blend-mode: screen:

.rgb {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: #00ff00; /* green channel */
}

.rgb::before,
.rgb::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  mix-blend-mode: screen; /* R + G + B = pure white */
  pointer-events: none;
}

.rgb::before { color: #ff0000; transform: translateX(-3px); }
.rgb::after  { color: #0000ff; transform: translateX(3px); }

Compare real screen channels against the classic text-shadow shortcut:

Top: real R+G+B channels with mix-blend-mode: screen. Bottom: tinted text-shadow copies

Where all three channels overlap, #f00 + #0f0 + #00f equals #fff. Where only two overlap, you automatically get clean yellow (R+G), cyan (G+B), and magenta (R+B) fringes — just like a real lens or CRT phosphor mask.

How mix-blend-mode: screen adds light

screen is the digital equivalent of aiming three projectors at the same dark wall. Mathematically, for each color channel (0 to 1), the browser computes 1 - (1 - a) * (1 - b).

  • Black (0) is invisible: anything screened over black stays unchanged.
  • Pure red (1, 0, 0) + pure green (0, 1, 0) + pure blue (0, 0, 1) = pure white (1, 1, 1).
  • At rest (translateX(0)), the word is indistinguishable from normal white typography. The moment the layers drift apart, the spectrum appears out of nowhere.
Hover or watch the channels separate — R, G and B collapse back into crisp white

This is the exact mechanism behind Chromatic Wave — driven by an @property clock and a damped sine wave so the split settles smoothly instead of snapping:

[FX_01] Pure CSSChromatic WaveRGB split text effect in pure CSS: red and blue copies of a word swing apart like a damped wave, then snap back. Tweak it and copy the code.Tweak it live & copy the code →

Why RGB split disappears on a white background (and the CMYK fix)

If you drop mix-blend-mode: screen onto a white page, the effect vanishes completely. Because screen only adds light, adding anything to #fff still equals #fff — pure white cannot get any brighter.

On light themes, flip from additive light (RGB + screen) to subtractive ink (CMYK + multiply):

.cmyk {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: #00ffff; /* cyan */
}

.cmyk::before,
.cmyk::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply; /* C * M * Y = black */
  pointer-events: none;
}

.cmyk::before { color: #ff00ff; transform: translateX(-3px); } /* magenta */
.cmyk::after  { color: #ffff00; transform: translateX(3px); }  /* yellow */

Here is why multiply works on paper-white backgrounds:

On a light background, Cyan + Magenta + Yellow with mix-blend-mode: multiply add up to crisp black

Use RGB + screen on dark backgrounds (#000–#1a1a1f) and CMY + multiply on light backgrounds (#eee–#fff).

Why isolation: isolate matters

Without isolation: isolate on the parent heading, the pseudo-elements do not just blend with the green text — they also blend with whatever sits behind the heading (a hero gradient, a card background, or a photo). That turns your white text pastel or washes out the red and blue edges.

isolation: isolate creates a fresh stacking context so screen (or multiply) stays strictly inside the text element:

Left: without isolation, channels bleed into the colored backdrop. Right: isolated cleanly

Real RGB split on images and glitch slices

The same channel-addition idea works beyond plain headings:

  • On images: stack three copies of the photo, filter each into a single channel with background-blend-mode: multiply over #f00 / #0f0 / #00f, then recombine the three layers with mix-blend-mode: screen. When you shift one layer on :hover, the photo splits into true optical channels without muddy hue-rotate() artifacts.
  • With torn slices: combine mix-blend-mode: screen with clip-path: inset() strips so the split only fires during a brief horizontal tear.

See both live and tweak their sliders:

[FX_05] Pure CSSGlitch ImageCSS glitch image hover effect: the photo splits into real red, green and blue channels and tears into strips, then settles with inertia. Any picture, no JS.Tweak it live & copy the code →
[FX_03] Pure CSSGlitch TextCSS glitch text effect: the word tears into strips that jump sideways while red and blue channels swing apart — then it rests. Pure CSS, any word.Tweak it live & copy the code →

Checklist: why mix-blend-mode is not working

When mix-blend-mode: screen appears to do nothing, it is almost always one of these five causes:

  1. The background is too light. screen on white or light gray produces white. Switch to multiply with #0ff / #f0f / #ff0.
  2. A parent broke the stacking context. opacity < 1, filter, transform, or z-index on a positioned wrapper creates a new stacking context, and blending stops at its edge. overflow: hidden alone does not. Put isolation: isolate directly on the text element itself — not on a wrapper around only one pseudo-element.
  3. Missing data-text attribute. content: attr(data-text) renders nothing if the HTML attribute is missing or misspelled.
  4. Pseudo-elements do not line up. Make sure the parent has position: relative and the pseudo-elements have position: absolute; inset: 0; with identical font, line-height, and letter-spacing.
  5. Text wraps to two lines. content: attr(data-text) on a multi-line heading can wrap differently if the parent width is tight. Keep RGB headings to a single line or set an explicit max-width and text-align.

Accessibility

Give screen readers one clean word (CSS ::before and ::after with content can be read aloud in some browser/screen-reader pairs, so use empty alt text syntax content: attr(data-text) / "" where supported) and turn off channel motion for people who prefer reduced motion:

.rgb::before,
.rgb::after {
  content: attr(data-text);
  content: attr(data-text) / ""; /* hides duplicate text from screen readers */
}

@media (prefers-reduced-motion: reduce) {
  .rgb::before,
  .rgb::after {
    animation: none;
    transform: none;
  }
}

FAQ

How do I do an RGB split in CSS without JavaScript?

Set the text color to #00ff00, add ::before (#ff0000) and ::after (#0000ff) with content: attr(data-text), position: absolute; inset: 0;, and mix-blend-mode: screen, then offset them by a few pixels with transform: translateX().

Why is my RGB split invisible on a white background?

mix-blend-mode: screen adds light, and white is already maximum brightness. On light backgrounds, switch to mix-blend-mode: multiply using cyan (#0ff), magenta (#f0f), and yellow (#ff0) so the overlap forms crisp black text.

Should I use CSS layers or an SVG filter for RGB split?

Use CSS mix-blend-mode: screen for headings and short text: the text stays selectable, crisp at any zoom, and easy to animate with @property or CSS variables. Use an SVG filter (feColorMatrix + feOffset) when you need to split an arbitrary container, icon, or <video> without duplicating HTML.

Is mix-blend-mode: screen supported in all browsers?

Yes. mix-blend-mode and isolation: isolate have full support in Chrome, Edge, Safari, and Firefox (desktop and mobile).