Thank you!
I used WASM4, which only supports 4 colors and I only used 2 of those. So basically I have a framebuffer into which I write 0 or 1 for each pixel. The actual color on screen is determined by a palette which is updated each frame.
To create different shades I used dithering (2x2 bayer matrix). There are some good tutorials on how to implement dithering online.