Closed 16amattice closed 1 month ago
Thanks for the PR! You honestly did a good job navigating our code base, but unfortunately there are a few issues:
fillToCss
must always return the same properties. Otherwise components will look incorrect if they switch from e.g. a FrostedGlassFill
to a SolidFill
, because properties like backdropFilter
will be left behind.blur
is measured in pixels instead of rem like everything else in rio.Looking at all this code again made me realize that it's overdue for a refactor, so I'm going to take care of that and then fix all of these issues. So unfortunately I can't accept this PR, but don't worry, your commits will be merged.
What does it do?
Added a new Fill type called FrostedGlassFill. This new fill type allows users to specify a color using RGB format (so you can specify the opacity of the color) and a blur in px, which is later converted to rem.
Why is it needed?
I wanted a way to be able to have see-through components with a blur added.
How to test it?
Create a rectangle and set the fill to FrostedGlassFill, providing color and blur. ex:
fill=rio.FrostedGlassFill(rio.Color.from_rgb(0, 0, 0, 0.4), 10),