MZ JavaScript: Generating a Bitmap from Color Hex?

I am trying to take a color hex, e.g. #686086, and create a 48x48 bitmap filled with it.

This is what I've tried so far-

colorBitmap_attempt01.png


In the above attempt, I think that I am going through each pixel of the bitmap and changing its bit values to represent the color specified.

I also tried,

colorBitmap_attempt02.png



However, in both cases, the bitmap still appears to be transparent.

I am hoping that somebody can spot where I am going wrong and/or point me in the right direction.

Thanks in advance 🙂
You can try:
characterBitmap.fillRect(0, 0, 48, 48, color)
You can try:
characterBitmap.fillRect(0, 0, 48, 48, color)
Perfect- Thanks!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/javascript-generating-a-bitmap-from-color-hex.148842/