ALPHAFLAT

A colour token from three inputs

Turn opacity into one solid colour.

Choose a foreground, its opacity and a known flat background. Get an opaque hex or RGB value, with the exact channel arithmetic beside it.

Encoded sRGBNormal source-overBrowser-local · free

Set the two colours.

Exactly #RRGGBB, without alpha.
One constant, fully opaque colour.
0–100 inclusive. Plain decimal; up to 12 decimal places. Surrounding spaces are ignored.

The working model matters. This tool calculates directly on encoded sRGB channels. Linear-light composition is a different calculation. The result is not a promise of matching every browser, editor or display.

A fixed background.

An opaque token depends on the background you enter. If that background changes, calculate a new token. One exported solid colour cannot retain transparency over other surfaces.

Why the background matters

Inspect the numbers.

Compare exact fractions with the rounded channels. At 50%, white over black yields 127.5 per channel in this model, exported as #808080.

Follow three worked examples

One clear scope.

One foreground over one opaque background. No files, layer stacks, contrast verdict, paint mixing or pixel sampling. Your input stays in the page.

Read the scope and limits