-
-
Notifications
You must be signed in to change notification settings - Fork 492
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 SCN 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
Colors used in the code editor can be configured using the console configuration file.
See also:
- online TIC-80 palette-editing tool.
- Another TIC-80 palette editor
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 into the palette editor:
1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
Some very old cartridges may still use this palette for backwards compatibility.
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)