BlendMode class final

The blend mode a PaintLayer composites with — the plan's own five and no others.

A value class rather than an enum. tool/structure.dart's own rule treats an enum in a published package as either a closed external format (glTF's alpha modes, its wrap modes) or machinery with a reviewed exemption; this is neither — it is a fixed algorithmic set the same way LightingModel is a fixed set of shaders, and that row's own answer is the shape used here: a final class with named const instances, the blend formula itself carried as a field rather than read off a switch.

Properties

hashCode → int
The hash code for this object.
no setterinherited
name → String
Shown in a status line or a test failure; not read by anything that changes behavior on it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

blendChannel(double top, double bottom) → double
This mode's own color math, top blended over bottom, both 0..1 — the part that differs between modes. Alpha itself is composited the same way regardless of mode; see PaintStack._over.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

add → const BlendMode
top + bottom, clamped to 1, per channel.
multiply → const BlendMode
top * bottom, per channel.
normal → const BlendMode
Plain alpha compositing: this layer's own color, mixed in by its own alpha over what is beneath it.
overlay → const BlendMode
bottom < 0.5 ? 2*top*bottom : 1 - 2*(1-top)*(1-bottom), per channel — multiply where the base is dark, screen where it is light.
screen → const BlendMode
1 - (1-top)*(1-bottom), per channel.
values → const List<BlendMode>
Every mode this class defines, for a picker to offer.