blendMode property

BlendMode get blendMode

A blend mode to apply when a shape is drawn or a layer is composited.

The source colors are from the shape being drawn (e.g. from Canvas.drawPath) or layer being composited (the graphics that were drawn between the Canvas.saveLayer and Canvas.restore calls), after applying the colorFilter, if any.

The destination colors are from the background onto which the shape or layer is being composited.

Defaults to BlendMode.srcOver.

See also:

Implementation

BlendMode get blendMode {
  final int encoded = _data.getInt32(_kBlendModeOffset, _kFakeHostEndian);
  return BlendMode.values[encoded ^ _kBlendModeDefault];
}
set blendMode (BlendMode value)

Implementation

set blendMode(BlendMode value) {
  final int encoded = value.index ^ _kBlendModeDefault;
  _data.setInt32(_kBlendModeOffset, encoded, _kFakeHostEndian);
}