def pattern.at
gralha-svg-render@0.1.0.1 · svg.bend:2231
import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-image@0.1.0.1/image.bend as Img
2231
2232def pattern.at(p: Point, +paintPoint: Point, +w: F32, +h: F32, opacity: F32,
2233 nodes: List<&2, Scene<Brush>>, paint: List<&2, Scene<Brush>> -> Point -> Point -> Img.Color) -> Img.Color:
2234 Point{x, y} = p
2235 +px = x
2236 +py = y
2237 +shift = {Point{(F32.floor((px / w : F32)) * w : F32), (F32.floor((py / h : F32)) * h : F32)} : Point}
2238 color.fade(paint(nodes)(point.sub(Point{px, py}, shift))(point.sub(paintPoint, shift)), opacity)