Available on:
See also: RGB COLOR

PALETTE

The PALETTE command allows you to define and modify the range of colors that can be used to draw on the screen. You can give a number for each element of the palette, sequentially. Thenumber is then used to refer to the specific color when drawing shapes or objects. Thanks to RGB function you can change the red, green and blue value of each color in the palette, allowing you to create custom color combinations, provided that the hardware allows it.

The palette is applied immediately to all the graphic elements on the screen. This allows you to define a color palette that adapts to the atmosphere of the game, creating particular visual effects. It allows to create transition effects between different colors, simulating for example the passage of time or changes in state. Finally, it customizes the appearance of the interface, making it more attractive and functional.

The maximum number of colors that can be defined in a palette varies depending on the video chipset and the mode selected.

SYNTAX

 PALETTE c0[,c1[,c2[,...]]]


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 PALETTE WHITE, RED, GREEN, BLUE
 PALETTE RGB(0,0,0),RGB(255,0,0),RGB(255,255,255)


Any problem?

If you have found a problem with this keyword, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO KEYWORDS