def color.premul.clamp

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

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

4459def color.premul.clamp(c: Img.Color) -> Img.Color:
4460  Img.Color{r, g, b, a} = c
4461  +alpha = U.clamp(a, 0.0, 1.0)
4462  Img.Color{U.clamp(r, 0.0, alpha), U.clamp(g, 0.0, alpha), U.clamp(b, 0.0, alpha), alpha}

Uses (2)

Used by (2)