pub enum BlendMode {
Show 17 variants
Normal,
Multiply,
Screen,
Lighter,
Overlay,
Darken,
Lighten,
ColorDodge,
ColorBurn,
HardLight,
SoftLight,
Difference,
Exclusion,
Hue,
Saturation,
Color,
Luminosity,
}Expand description
Defines how new pixels are composited with existing pixels on the canvas.
Maps directly to the CSS globalCompositeOperation property.
Variants§
Normal
The source is drawn over the destination (default alpha blending).
Multiply
The source color is multiplied with the destination, producing a darker result.
Screen
The source and destination are inverted, multiplied, then inverted again.
Lighter
The source and destination colors are added together, clamped to maximum brightness.
Overlay
Combines Multiply and Screen based on the destination color.
Darken
Keeps the darker of the source and destination per channel.
Lighten
Keeps the lighter of the source and destination per channel.
ColorDodge
Dodges the destination color brightening it based on the source.
ColorBurn
Burns the destination color darkening it based on the source.
HardLight
A harsher version of Overlay using the source color as the filter.
SoftLight
A softer version of Overlay using the source color as the filter.
Difference
Subtracts the darker color from the lighter color per channel.
Exclusion
Similar to Difference but with lower contrast.
Hue
Uses the hue of the source with the saturation and luminosity of the destination.
Saturation
Uses the saturation of the source with the hue and luminosity of the destination.
Color
Uses the hue and saturation of the source with the luminosity of the destination.
Luminosity
Uses the luminosity of the source with the hue and saturation of the destination.