def pixels.join

gralha-image@0.1.0.1 · image.bend:25

import gralha-image@0.1.0.1/image.bend as Image
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

25def pixels.join(+a: Pixels, +b: Pixels, +c: Pixels, +d: Pixels) -> Pixels:
26  match a b c d:
27    case Flat{aa} Flat{bb} Flat{cc} Flat{dd}:
28      U.choose(Pixels, color.same(aa, bb) && color.same(aa, cc) && color.same(aa, dd), Flat{aa}, Quad{a, b, c, d})
29    case _ _ _ _: Quad{a, b, c, d}

Uses (4)

Used by (5)