addBitmapData() - returns a Bitmap with BitmapData added
color() - does a floodFill but saves a half dozen complicated lines
const assets = "ai_coloring_groovy.png";
const path = "https://zimjs.org/assets/"; // fix the URL!
new Frame(FIT, 1481, 745, light, dark, ready, assets, path);
function ready() {
const pic = new Pic("ai_coloring_groovy.png");
const bitmap = new Bitmap(pic)
.addBitmapData() // new - returns a new Bitmap with a bitmapData property
.scaleTo()
.cur()
.center();
const color = series(red, orange, blue, green, yellow);
bitmap.on("mousedown", ()=>{
bitmap.color(color); // or get from ColorPicker()
S.update();
});
}
cool, any idea how to make a matching game.. so it need to be the exact color of the original drawing..
thanks to make an easy method to color with floodfill but it isn't yet a matching color game ofcource // so with a legend for example
so your example idea , but the button does not update the tile correctly, it comes black,