Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:29 14 Jun 2026 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : RP2350B Computer preassembled board form Silicon Chip

Author Message
RicM
Regular Member

Joined: 05/02/2022
Location: Australia
Posts: 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: Australia
Posts: 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.
  Quote  MODE 3 640 x 480 x 16 colours.
Colour mapping to RGB555 palette.

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.
> mode 3
> for m=0 to 2:for n=0 to 255:c=n<<(m*8):pixel 9,9,c :if pixel(9,9)=c then:? m,n :endif:next:next
0       0
0       255
1       0
1       64
1       128
1       255
2       0
2       255
>

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

Edited 2026-06-13 16:20 by phil99
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026