216 COLORS IN MAKECODE?! ...sort of

The other day, somebody suggested mapping the palette to red, green and blue colors and making colors from those three colors. I wasn’t sure it would work, but I tried anyway (spoiler alert - it didn’t work.)

I wrote this script for creating a pixel, with three subpixels - red, green, and blue. Each subpixel has 6 shades, from 0 (off) to 5 (brightest). This produces 6 ^ 3 combinations or 216 combinations total.

In the following example, you can see a pixel on screen having its subpixels randomised. My idea was to try and draw with these pixels, but it seems as if the pixels can’t be small enough. If I scale up the screen enough to fit 160x120 of these “big pixels” I made (3x3 each) to a resolution of 480x360, the subpixels are still highly visible, defeating the purpose of this experiment.

Pixels work by tricking our eyes into seeing multiple colors blened as one. No matter how high I made the resolution, all three subpixels would still be visible, and it would look like a mess. I even scaled the screen up to resolutions of 1440x1080, but at that point this method would become unusuable due to the lag (and the subpixels were still visible!)

So, in short - while it is an amusing idea, it is unfortunately not doable in makecode.

14 Likes

Aww… so close…

3 Likes

Hmm… are you sure it’s game over? What about if the pattern really did repeat across the whole screen?

2 Likes

Tried it with max values (5, 5, 5). Since they are mapped to RGB(255, 255, 255) or in other words #FFFFFF, the entire screen should have been white. Unfortunately, the pattern was very clearly visible at any resolution.

Here’s what that looks like @ 480x360

7 Likes

As much as this seems it wouldn’t work, it actually does! You need to paste it all over the screen, which creates the illusion of fluidity. This would make it so it tricks the eyes into blending the entire screen into one color! If you try this, it may work.

2 Likes

Bad timing, lol

6 Likes

Can change the colors?

2 Likes

I’ve done some dithering stuff before and the colours turned out really well


This is just red and purple from the default makecode palette but it looks really accurate even at this small resolution
image
Is there some kind of limited spectrum that could be achieved?
Basically instead of RGB what about using other colours

6 Likes

That would be dithering, not RGB. It’s actually a common method used on old consoles to give the illusion of more colors!

5 Likes

Try doing a checkerboard pattern instead of all pixels having 3 bars? (So kinda like dithering @Luke mentioned)

5 Likes

OOF not quite… Thanks for trying!

2 Likes

Ahh so a 2 color mix does work!

3 Likes

this gives me a headache…

2 Likes

wow

4 Likes

Okay, that made it better! Still not perfect, and increasing the resolution doesn’t make it much better (also ruins performance)

This is the subpixel pattern I used

Maybe changing the pattern could make it look better?

(This is full white 5, 5, 5)

8 Likes

Fond out why it doesn’t work. You know about color printers? they use 0xff00ff-1 0x00ffff-2 0xffff00-3 0x000000.
if you print a color with 1 at 100%
2 at 75 % and 3 at 50% you can remove 3 and 25% of 2 and
50% of 1 from the color and add 50% of 4 you get the same color.
You can do the same with red green blue white.

1 Like

Oooo much better! Took me a bit to spot the pixels!

3 Likes

like this?

4 Likes

Don’t use cmyb that only works with paint use rgbw that will work with displays.

2 Likes

As someone who paints I am very confused about the use of cyan, magenta, yellow and blue paint to mix colours

2 Likes