Declaration ​
pascal
function ColorAdd(F, B: TColor32): TColor32;
function ColorSub(F, B: TColor32): TColor32;
function ColorDiv(F, B: TColor32): TColor32;
function ColorModulate(F, B: TColor32): TColor32;
function ColorMax(F, B: TColor32): TColor32;
function ColorMin(F, B: TColor32): TColor32;
function ColorDifference(F, B: TColor32): TColor32;
function ColorAverage(F, B: TColor32): TColor32;
function ColorExclusion(F, B: TColor32): TColor32;
function ColorScale(F, B: TColor32): TColor32;
function ColorScreen(F, B: TColor32): TColor32;
function ColorDodge(F, B: TColor32): TColor32;
function ColorBurn(F, B: TColor32): TColor32;
function BlendColorAdd(F, B: TColor32): TColor32;
function BlendColorModulate(F, B: TColor32): TColor32;Parameters ​
| Parameter | Type | Description |
|---|---|---|
F | TColor32 | Foreground pixel color. |
B | TColor32 | Background pixel color. |
Returns ​
| Type | Description |
|---|---|
TColor32 | The blended 32-bit ARGB result color. |
Description ​
This group of functions implements color channel arithmetic and Photoshop-style compositing blend modes between foreground color
Available Blend Modes ​
| Name | Formula / Operation | Description |
|---|---|---|
ColorAdd | Additive blending with channel saturation. | |
ColorSub | Subtractive blending with zero clamping. | |
ColorDiv | Division of background by foreground. | |
ColorModulate | Multiplicative modulation (darkening). | |
ColorMax | Component-wise maximum color selection. | |
ColorMin | Component-wise minimum color selection. | |
ColorDifference | Absolute channel difference. | |
ColorAverage | Component-wise average. | |
ColorExclusion | Exclusion blend mode (soft contrast inversion). | |
ColorScale | Scaled multiplication. | |
ColorScreen | Screen blend mode (lightening blend). | |
ColorDodge | Color dodge blend mode (brightening). | |
ColorBurn | Color burn blend mode (darkening). | |
BlendColorAdd | ColorAdd modulated by | Additive blending modulated by foreground alpha. |
BlendColorModulate | ColorModulate modulated by | Multiplicative modulation modulated by foreground alpha. |
INFO
All these functions are actually delegates; At startup, Graphics32 binds them to the optimal implementation (Pure Pascal, x86/x64 assembly, or SSE2 vector instructions) supported by the host CPU.