def mask.apply
gralha-svg-render@0.1.0.1 · svg.bend:2868
import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
import gralha-image@0.1.0.1/image.bend as Img
2868
2869def mask.apply(+c: Img.Color, +opacity: F32, mode: U32, render: Unit -> Img.Color) -> Img.Color:
2870 Img.Color{r, g, b, a} = c
2871 U.branch(Img.Color, F32.is_gt(a, 0.0) && F32.is_gt(opacity, 0.0),
2872 _ => color.fade(c, (opacity * mask.factor(mode, render) : F32)), _ => Img.clear())