Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply blend modes on layer level and add Multiply blend mode #2519

Merged
merged 4 commits into from
Jul 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for Multiply blend mode
BlendModeCompat is designed to use either a BlendMode (added in Android
Q) or PorterDuff.Mode (always available).

Our support for Lottie blend modes did not include Multiply due to a
slightly different formula between the PorterDuff and BlendMode
variants.

However, we did include support for Screen, which suffers from a similar
behavior. Therefore, we are not breaking any consistency by including
Multiply too, and including it provides benefits in terms of more
complete support, as Multiply is a foundational blend mode.
  • Loading branch information
geomaster committed Jul 23, 2024
commit 32166a61fc18cdfc6e1867922259bb58501ade5f
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public BlendModeCompat toNativeBlendMode() {
switch (this) {
case NORMAL:
return null;
case MULTIPLY:
return BlendModeCompat.MULTIPLY;
case SCREEN:
return BlendModeCompat.SCREEN;
case OVERLAY:
Expand All @@ -48,7 +50,6 @@ public BlendModeCompat toNativeBlendMode() {
// To prevent unexpected issues where animations look correct
// during development but silently break for users with older devices
// we won't support any of these until Q is widely used.
case MULTIPLY:
case COLOR_DODGE:
case COLOR_BURN:
case HARD_LIGHT:
Expand Down
Loading