How to render/blend layers with transparency/alpha #669
-
|
I am using the composition api to split my app into a couple of layers. And I want to implement a top layer with a dialog that has a transparent backdrop as to darken the layers underneath. But when I give that layer an Is there some layer blending mode I need to enable somewhere? Or is this outside of the realm of what lipgloss is capable of? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
The way the compositor, and thus the canvas works right now, a top layer that writes to a cell (regardless of whether it's just alpha changes) will replace the underlying cells. Not sure if that's something that would be easy to support in the compositor either (calculating the merging of two colors when the alpha value is References where I also discuss this (and may look at making a PR to simplify this for users):
Take a look at one of my apps, which is probably the simplest implementation that I can think of right now:
The tl;dr is:
The result: WindowsTerminal_7rhf8QVeFI.mp4 |
Beta Was this translation helpful? Give feedback.
The way the compositor, and thus the canvas works right now, a top layer that writes to a cell (regardless of whether it's just alpha changes) will replace the underlying cells. Not sure if that's something that would be easy to support in the compositor either (calculating the merging of two colors when the alpha value is
< 1). That said, there are other ways to do backdrops.References where I also discuss this (and may look at making a PR to simplify this for users):