Repository URL to install this package:
Version:
0.70.0.dev5556 ▾
|
from typing import Optional
from flet.controls.base_control import control
from flet.controls.border_radius import BorderRadiusValue
from flet.controls.constrained_control import ConstrainedControl
from flet.controls.control import Control
from flet.controls.gradients import Gradient
from flet.controls.types import BlendMode
__all__ = ["ShaderMask"]
@control("ShaderMask")
class ShaderMask(ConstrainedControl):
"""
Applies a mask generated by a shader to its [`content`][(c).].
For example, it can be used to gradually fade out the edge of a control by
using a [`LinearGradient`][flet.LinearGradient] mask.
"""
shader: Gradient
"""
Use gradient as a shader.
"""
content: Optional[Control] = None
"""
The Control to which the [`shader`][flet.ShaderMask.shader] is applied.
"""
blend_mode: BlendMode = BlendMode.MODULATE
"""
The blend mode to use when applying the shader to the [`content`][flet.ShaderMask.content].
"""
border_radius: Optional[BorderRadiusValue] = None
"""
The radius of the mask.
"""