def raster.color
gralha-svg-render@0.1.0.1 · svg.bend:2278
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
2278def raster.color(+r: Raster, p: Point, +linear: Bool) -> Img.Color:
2279 Raster{origin, step, width, height, depth, pixelsLinear, pixels} = r
2280 +c = raster.sample(r, p)
2281 U.branch(Img.Color, U.choose(Bool, pixelsLinear, linear, Bool.not(linear)), _ => c,
2282 _ => U.branch(Img.Color, pixelsLinear, _ => color.from.linear(c), _ => color.space(c, True{})))