Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5478052

Browse files
authored
Mention the point of BlendMode.plus and advise on using it. (#44189)
1 parent a363e9b commit 5478052

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/ui/painting.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ enum BlendMode {
544544
///
545545
/// This corresponds to the "Source plus Destination" Porter-Duff operator.
546546
///
547+
/// This is the right blend mode for cross-fading between two images. Consider
548+
/// two images A and B, and an interpolation time variable _t_ (from 0.0 to
549+
/// 1.0). To cross fade between them, A should be drawn with opacity 1.0 - _t_
550+
/// into a new layer using [BlendMode.srcOver], and B should be drawn on top
551+
/// of it, at opacity _t_, into the same layer, using [BlendMode.plus].
552+
///
547553
/// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_plus.png)
548554
plus,
549555

0 commit comments

Comments
 (0)