ALPHAFLAT

Worked examples

Three colours, with the arithmetic left in.

Each example uses the same single foreground-over-opaque-background model. Channel numbers are encoded sRGB values on a 0–255 scale. A fraction or decimal below is the mathematical result before the final 8-bit export.

25% blue over a warm background

Foreground
#2468AC = (36, 104, 172)
Background
#F0E0C0 = (240, 224, 192)
Opacity
25% = 1/4

Red: (36 + 3 × 240) / 4 = 189.
Green: (104 + 3 × 224) / 4 = 194.
Blue: (172 + 3 × 192) / 4 = 187.

All channels are integers already. The exported value is #BDC2BB, or rgb(189, 194, 187). This is the calculator's reset example.

40% rust over a dark blue

Foreground
#CC6633 = (204, 102, 51)
Background
#204060 = (32, 64, 96)
Opacity
40% = 2/5

Red: (2 × 204 + 3 × 32) / 5 = 504/5 = 100.8.
Green: (2 × 102 + 3 × 64) / 5 = 396/5 = 79.2.
Blue: (2 × 51 + 3 × 96) / 5 = 78.

The exact channels are not all integers. Nearest-integer export gives (101, 79, 78), which serialises as #654F4E. The displayed token is the rounded result; the fractions remain useful when checking the calculation.

The exact half: white over black

Foreground #FFFFFF, background #000000, opacity 50%. Every channel becomes (255 + 0) / 2 = 255/2 = 127.5. An exact half rounds upward under this tool's chosen export rule, so every 8-bit channel is 128.

The exported colour is #808080. This is the midpoint of encoded channel numbers. It is not a linear-light midpoint or a universal browser-pixel promise.

Check the endpoints

At 0% opacity, the result is exactly the entered background. At 100%, it is exactly the foreground. Identical foreground and background colours are unchanged at any accepted opacity. Between those endpoints each exact channel stays within the two entered channel values, even when the colours differ on all three channels.

Try the examples in the calculator. Changing the background or opacity should change the exported token; it does not modify the original colour values or upload them anywhere. The method guide explains the model and rounding decisions in more detail.