User Tools

Site Tools


ugbasic:user:kw:palette
Translations of this page:


ugBASIC User Manual

PALETTE

SYNTAX

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

PURPOSE

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.

EXAMPLE

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

AVAILABLE ON

SEE ALSO

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY