def mask.value

gralha-svg-render@0.1.0.1 · svg.bend:2861

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

2861def mask.value(c: Img.Color, mode: U32) -> F32:
2862  Img.Color{r, g, b, a} = c
2863  U.choose(F32, U32.is_eq(mode, 1), a, (r * 0.2126 + g * 0.7152 + b * 0.0722 : F32))

Uses (7)

Used by (1)