Get the exact inverse of any color
This tool computes the precise inverse of a color by subtracting each RGB channel from 255 — the same operation as a photographic negative. It is useful for generating dark-mode counterparts, finding a high-contrast accent, or simply seeing what the “opposite” of a color looks like.
How it works
A color in RGB is three numbers from 0 to 255 for red, green, and blue. The inverse is found channel by channel with a single subtraction:
inverse_R = 255 - R
inverse_G = 255 - G
inverse_B = 255 - B
So rgb(52, 152, 219) becomes rgb(203, 103, 36). White (255,255,255) inverts to black (0,0,0) and vice versa, and a fully saturated red #ff0000 inverts to cyan #00ffff.
This is the literal numeric inverse, sometimes called the complementary color. Note that it differs from a hue-rotation complement: subtracting from 255 flips each channel independently, which can shift lightness as well as hue. The tool shows the original and inverted swatches side by side so you can judge the contrast at a glance.
How inverting pairs work out in practice
| Original | Inverse | Notes |
|---|---|---|
White #ffffff | Black #000000 | Maximum contrast pair |
Red #ff0000 | Cyan #00ffff | Primary / secondary complement |
Green #00ff00 | Magenta #ff00ff | Primary / secondary complement |
Blue #0000ff | Yellow #ffff00 | Primary / secondary complement |
Mid-gray #808080 | Near-gray #7f7f7f | Almost identical — poor contrast |
Navy #3498db | Orange-brown #cb6724 | A commonly used accent pair |
Pure primary colors always invert to their secondary complement and vice versa, which is why the RGB inverse is so useful for finding natural-feeling contrast pairs. Gray is the notable exception — any gray near the midpoint of the 0–255 range inverts to something nearly identical, making it unsuitable as an inversion-based contrast.
Practical uses
Dark-mode generation: Take a light-background design color and invert it to see a rough dark-mode version. This is a starting point — in practice you may want to adjust lightness further — but it is faster than guessing.
Accent discovery: If your brand color is a cool blue, its inverse is a warm orange. That orange is often a natural high-contrast accent choice that feels harmonious precisely because it sits opposite on the spectrum.
Image editing and CSS filters: The CSS filter: invert(1) property applies exactly this channel subtraction to images and elements. Understanding the math helps predict what invert(1) will do to your UI components.
Double inversion: Inverting twice always returns the exact original, because (255 − (255 − x)) = x. This makes inversion a lossless, reversible operation.
Note on mid-gray
Colors near mid-gray (128,128,128) invert to something very close to themselves. This is useful to know if you are relying on inversion for accessibility — gray-on-near-gray has poor contrast. Start from a saturated, non-gray color for the most useful inversions.