Color Scheme Studio
← All Color 101 guides

Color 101 / Digital colour

Opacity vs alpha: why transparent colors change

A colour can keep its RGB values and still look different when it becomes transparent. The background now helps make the result.

Transparency is a relationship between layers.

A solid swatch specifies a colour. A partly transparent swatch also needs a background before you know the visible result.

Alpha controls how much of a layer shows

In a screen colour, alpha describes transparency: 0 is fully transparent and 1 is fully opaque. The same endpoints can be written as 0% and 100%. For example, rgb(220 100 80 / 50%) specifies coral with half alpha. Its red, green and blue components are still 220, 100 and 80; the extra value changes how it combines with what is behind it.

When an app uses the word transparency instead, check the direction of its slider. “100% transparent” and “100% opaque” describe opposite endpoints. Start by making a sample fully visible and fully invisible, then return to a middle setting. That is a more reliable check than guessing what the label means in an unfamiliar tool.

One coral, two visible results

Both large fields below contain the same coral square. Move the alpha slider and compare the squares, not the surrounding labels. At 100% alpha the two squares match. Reduce it and their backgrounds increasingly influence the result.

White background
Dark blue background
Same RGB colour, 50% alpha. The backgrounds are different.

At the starting setting, coral over white looks pale; coral over dark blue looks deeper and more subdued. This is actual compositing, not just a surrounding-colour illusion. A screenshot or eyedropper samples the combined visible pixels, so it may return different RGB values from the coral you originally entered.

For a simple normal-mode example over an opaque background, each output channel is the source channel multiplied by alpha plus the background channel multiplied by one minus alpha. Half-alpha coral over white gives approximately rgb(238 178 168) when calculated directly in these sRGB channel values. Other colour spaces or blending settings can change the calculation; this example is not a universal paint-mixing rule.

A transparent fill can keep the lettering solid

Colour alpha and whole-element opacity affect different things. On a web page, alpha in the background colour affects that fill. The CSS opacity property applies to the element as a group, including its text and children. The comparison below uses the same white surface and dark lettering in both cards.

Studio notesThe fill is translucent.
The lettering stays opaque.
Background alpha: 50%
Studio notesThe whole card fades,
including its lettering.
Whole-card opacity: 50%

Imagine placing a caption over a photograph. If you want a translucent panel with crisp text, adjust the panel fill rather than fading the whole group. In a drawing app, inspect whether you selected a fill, one object or a group. Similar-looking controls can target different parts of the artwork. Make a duplicate before experimenting so you can compare what changed.

Decide whether the background travels with the file

A translucent logo on a pale canvas may look different when placed on a dark slide. Before handing it over, put it on both surfaces. If it must always look exactly like the approved pale version, include that background or prepare an opaque colour version. If it should blend into many backgrounds, preserve its transparency and test the actual destinations.

A file with transparency has not stored one finished colour for every partly transparent pixel. PNG can preserve alpha; JPEG cannot preserve that transparency. After exporting, reopen the file and place it over a strongly coloured field. A white rectangle that appears behind the artwork can reveal that the transparency was flattened during export.

Also check text after choosing the final background. A contrast measurement made for an opaque swatch does not automatically apply to that swatch at reduced alpha. Inspect the combined foreground and background actually used. A pleasant translucent surface can still make small lettering harder to read.

Keep the original colour and the visible result separate

When recording a transparent colour, keep its RGB or HEX value together with its alpha and intended background. That small note prevents a common handoff problem: someone copies the right colour but cannot reproduce the appearance. If you need one fixed, solid swatch instead, sample or calculate the composite for the chosen background and clearly label it as an opaque result.

Sources and further reading

Technical definitions and compositing behaviour are supported by the references below. The coral experiment, card comparison and workflow examples are original studies created for this guide.