Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
RicM Regular Member Joined: 05/02/2022 Location: AustraliaPosts: 55
Posted: 02:40am 12 Jun 2026
Copy link to clipboard
Print this post
Dear Members,
I have found on the above that Mode 3 in 4-bit colour is 16 colours.
Can anyone tell me the 16 colours.
Regards,
RicM
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3279
Posted: 03:27am 12 Jun 2026
Copy link to clipboard
Print this post
If this is the VGA one the colour pallet you see on the monitor is set by the resistor values. If it is the HDMI one you can map your own colours. This command line program should read out the valid colours from the screen buffer. The value of M gives the primary colour, 0=blue, 1=green, 2=red and N is the level.
So that is black, RGB(0,0,0), RGB(0,0,255), RGB(0,64,0), RGB(0,64,255), RGB(0,128,0), RGB(0,128,255), RGB(0,255,0), RGB(0,255,255), RGB(255,0,0), etc. to RGB(255,255,255) white.
In reverse order. white, yellow, lilac, brown, fuchsia, rust, magenta, red, cyan, green, cerulean, midgreen, cobalt, myrtle, blue and black.
To make the primaries visible on the screen:-
for m=0 to 2:for n=0 to 255:c=n<<(m*8):CLS c :if pixel(9,9)=c then:? m,n :Pause 999:endif:next:next
Or all 16.
for R=0 to 255 step 255:for G=0 to 255 step 64:for B=0 to 255 step 255:cls RGB(R,G,B):pause 555:next:next:next