Well then! You could consider adding a 3rd dimension, then using Render3D. Store a “which part of the picture is it” flag in the 3rd coordinate of the map, then:
export function render3D(index, x, y, z) {
if (z == 0) {
if (showLamb) {
colorLamb(x,y)
return
}
} else {
if (showBackground) {
colorBackground(x, y)
return
}
}
rgb(0,0,0) // default
}
I have a map in which I store θ (angle) in z so I don’t have to do trig at render time. Works great but looks a little funny in the map view!