def gradient.color
gralha-svg-render@0.1.0.1 · svg.bend:2175
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
2175def gradient.color(xs: List<&2, Stop>, +t: F32) -> Img.Color:
2176 match xs:
2177 case Nil{}: Img.clear()
2178 case Con{Stop{o, c}, rest}:
2179 +ink = c
2180 +offset = o
2181 U.branch(Img.Color, F32.is_lt(t, offset), _ => ink,
2182 _ => gradient.interval(rest, Stop{offset, ink}, t))