That looks really neat! There are actually some options that might help you to do it without having to have separate images for each colour (or dither/non-dithered):
When given a 1 or 2 bit unpaletted image, g.drawImage will use the background + foreground colors - so using a pre-dithered black and white image will then allow you to draw that out in whatever colors you want (or fg+bg the same to have no dither). Using 2 bit allows you to get black+white, plus another color used to signal transparency.
It might be possible to use g.drawImages to layer up the number as well as your dither pattern
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
That looks really neat! There are actually some options that might help you to do it without having to have separate images for each colour (or dither/non-dithered):
g.drawImage
will use the background + foreground colors - so using a pre-dithered black and white image will then allow you to draw that out in whatever colors you want (or fg+bg the same to have no dither). Using 2 bit allows you to get black+white, plus another color used to signal transparency.g.drawImages
to layer up the number as well as your dither pattern