Color & Display

Color Mix & Alpha Composite Calculator

Compare encoded sRGB, linear-light and Oklab interpolation, or composite one color over an opaque background.

How the calculation works

Transform colors to the selected space, calculate t×first+(1−t)×second, transform back to sRGB and report any channel clipping. Source-over an opaque background has the same weighted form with t=foreground alpha.

Worked example

Example inputs — First / foreground hex: #000000; Second / opaque background hex: #FFFFFF; First-color mixing weight (%): 50; Foreground opacity for source-over (%): 50; Operation: mix; Calculation space: srgb. Expected results — Result hex: #808080 sRGB hex; Unrounded encoded RGB channels: 127.5, 127.5, 127.5 0–255; Relative luminance before hex quantization: 0.2140411405; Gamut assessment: Inside sRGB.

Assumptions and limits

Mathematical color model with stated reference conventions; device calibration, viewing conditions and color-management profiles affect practical appearance. Mix uses the weight field; source-over uses opacity. Background is opaque. Oklab is supported for interpolation only. Final out-of-gamut channels are clipped to sRGB and explicitly reported; no perceptual gamut mapping. Hex uses nearest 8-bit quantization, so its luminance may differ slightly from the unrounded result.

Reference and further reading

Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.

Related calculators

Browse all 1000 calculators →

Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.