Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
flet / controls / core / shader_mask.py
Size: Mime:
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.
    """