def filter.blend.rgb

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

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

4600def filter.blend.rgb(+a: Img.Color, +b: Img.Color, +kind: U32) -> Img.Color:
4601  Img.Color{ar, ag, ab, aa} = a
4602  Img.Color{br, bg, bb, ba} = b
4603  U.branch(Img.Color, U32.is_eq(kind, 12), _ => filter.blend.setlum(filter.blend.setsat(a, filter.blend.sat(b)), filter.blend.lum(b)),
4604    _ => U.branch(Img.Color, U32.is_eq(kind, 13), _ => filter.blend.setlum(filter.blend.setsat(b, filter.blend.sat(a)), filter.blend.lum(b)),
4605      _ => U.branch(Img.Color, U32.is_eq(kind, 14), _ => filter.blend.setlum(a, filter.blend.lum(b)),
4606        _ => U.branch(Img.Color, U32.is_eq(kind, 15), _ => filter.blend.setlum(b, filter.blend.lum(a)),
4607          _ => Img.Color{filter.blend.channel(ar, br, kind), filter.blend.channel(ag, bg, kind), filter.blend.channel(ab, bb, kind), 1.0}))))

Uses (9)

Used by (1)