From f5d11a604043f27528fdde79a7c0cccf7a430cb1 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Mon, 31 Jul 2023 14:33:22 -0700 Subject: [PATCH] Mention the point of BlendMode.plus and advise on using it. --- lib/ui/painting.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index b0f5a60a7c94e..2849c4b1c178a 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -544,6 +544,12 @@ enum BlendMode { /// /// This corresponds to the "Source plus Destination" Porter-Duff operator. /// + /// This is the right blend mode for cross-fading between two images. Consider + /// two images A and B, and an interpolation time variable _t_ (from 0.0 to + /// 1.0). To cross fade between them, A should be drawn with opacity 1.0 - _t_ + /// into a new layer using [BlendMode.srcOver], and B should be drawn on top + /// of it, at opacity _t_, into the same layer, using [BlendMode.plus]. + /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_plus.png) plus,