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 mattersA colour token from three inputs
Choose a foreground, its opacity and a known flat background. Get an opaque hex or RGB value, with the exact channel arithmetic beside it.
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.
Rounded 8-bit hex
Output alpha:
| Channel | Exact | Decimal ≈ | 8-bit |
|---|---|---|---|
| Red | |||
| Green | |||
| Blue |
Decimal approximations show up to 12 places. Hex and RGB round the exact fractions to nearest integers; an exact half rounds upward.
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 mattersCompare 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 examplesOne 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