compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Support for "Plus Darker" and "Plus Lighter" blend modes

Open iamcalledrob opened this issue 1 year ago • 1 comments

These two blend modes (Plus Darker, Plus Lighter) are very useful when building UI, in particular, for iOS -- yet they are missing in Compose Multiplatform.

The web now somewhat supports this kind of blending via css mix-blend-mode:

mix-blend-mode: plus-darker;
mix-blend-mode: plus-lighter;

Sidenote: I believe "Plus Darker" is also known as "Linear Burn"

Here's Figma's video showing the effect of this type of blending -- as you can see, this is necessary for building native looking UI for Apple platforms.

https://github.com/JetBrains/compose-multiplatform/assets/87964/179b8661-5c8b-4452-b8bc-5e299b399cd2

Alternatively, support for custom blend mode formulae might be even more versatile

More reading:

iamcalledrob avatar Jun 28 '24 18:06 iamcalledrob

I believe this may also be made possible via a shader if RuntimeEffect.makeForBlender() (skia: SkRuntimeEffect::makeBlender) was made available within Skiko -- it's conspicuously missing.

Skiko RuntimeEffect.kt Skia SkRuntimeEffect::makeBlender

iamcalledrob avatar Jun 28 '24 18:06 iamcalledrob

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Jul 14 '24 14:07 okushnikov