-
-
Notifications
You must be signed in to change notification settings - Fork 488
Palette
All TIC-80 games use a palette of 16 colors drawn from 24-bit colorspace (16 million possible colors). The TIC-80 default palette for all new cartridges is SWEETIE-16.
The game's starting palette can be modified using the Sprite Editor in advanced mode.
You can alter the palette at runtime using the poke command and poking into the PALETTE
area of VRAM. You can replace the whole palette this way, or just a single color.
For more temporary swaps (within a palette) PALETTE MAP
VRAM is what you need. Let's say we have a sprite that's largely blue but now we'd like a variant that's red (replacing all the blue pixels with red). We don't need a second sprite for this - we can just update the palette map.
PALETTE_MAP = 0x3FF0
blue = 9
red = 2
poke4(PALETTE_MAP * 2 + blue, red) -- swap the colors
-- draw the sprite
poke4(PALETTE_MAP * 2 + blue, blue) -- swap them back
See also PALETTE MAP.
By combining poke and BDR creatively you can potentially display up to 2,176 colors on screen simultaneously (16 colors x 136 scanlines). As always, each scanline is still restricted to 16 colors.
Example
This allows to store more sprites and tiles. See the Bits Per Pixel page.
If you don't like the default palette and would like to use a custom palette for all your projects, you can modify the default cart template and therefore its palette, using config default
command.
Do not forget to save.
Colors used in the code editor can be configured using the configuration file. One can also change the configuration file palette to customize all editors.
Color | Index | Hex |
---|---|---|
Black | 0 | 1A1C2C |
Purple | 1 | 5D275D |
Red | 2 | B13E53 |
Orange | 3 | EF7D57 |
Yellow | 4 | FFCD75 |
Light Green | 5 | A7F070 |
Green | 6 | 38B764 |
Dark Green | 7 | 257179 |
Dark Blue | 8 | 29366F |
Blue | 9 | 3B5DC9 |
Light Blue | 10 | 41A6F6 |
Cyan | 11 | 73EFF7 |
White | 12 | F4F4F4 |
Light Grey | 13 | 94B0C2 |
Grey | 14 | 566C86 |
Dark Grey | 15 | 333C57 |
Or in a form that can be pasted in the palette editor:
1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
The palette editor is accessible in the advanced mode of the sprite editor, with the icon on the right of the palette. The paste icon is on the right of the palette editor.
Some old cartridges may still use this palette for backwards compatibility.
Find other palettes on Lospec website where you can set the number of colors to be exactly 16 and download the hex file which content can be copy-pasted to the sprite editor.
TIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
Platform
RAM & VRAM | Display | Palette | Bits per Pixel (BPP) |
.tic
Format | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
- BDR (0.90)
- BOOT (1.0)
- MENU
- OVR (deprecated)
- SCN (deprecated)
- TIC
- btn & btnp
- circ & circb
- clip
- cls
- elli & ellib (0.90)
- exit
- fget & fset (0.80)
- font
- key & keyp
- line
- map
- memcpy & memset
- mget & mset
- mouse
- music
- peek, peek4
- peek1, peek2 (1.0)
- pix
- pmem
- poke, poke4
- poke1, poke2 (1.0)
- rect & rectb
- reset
- sfx
- spr
- sync
- ttri (1.0)
- time
- trace
- tri & trib (0.90)
- tstamp (0.80)
- vbank (1.0)