Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
palette.h File Reference

Detailed Description

Design Philosophy

Even though the TFT supports 16 bit color, a 16 bit frame-buffer is too big to have in RAM alongside games and such. Instead, the 8 bit Web Safe palette is used, where each RGB channel has six options for a total of 216 colors. The paletteColor_t enum has values for all colors in the form of cRGB, where R, G, and B each range from 0 to 5. For example, c500 is full red. cTransparent is a special value for a transparent pixel.

Go to the source code of this file.

Enumerations

enum  paletteColor_t {
  c000 , c001 , c002 , c003 ,
  c004 , c005 , c010 , c011 ,
  c012 , c013 , c014 , c015 ,
  c020 , c021 , c022 , c023 ,
  c024 , c025 , c030 , c031 ,
  c032 , c033 , c034 , c035 ,
  c040 , c041 , c042 , c043 ,
  c044 , c045 , c050 , c051 ,
  c052 , c053 , c054 , c055 ,
  c100 , c101 , c102 , c103 ,
  c104 , c105 , c110 , c111 ,
  c112 , c113 , c114 , c115 ,
  c120 , c121 , c122 , c123 ,
  c124 , c125 , c130 , c131 ,
  c132 , c133 , c134 , c135 ,
  c140 , c141 , c142 , c143 ,
  c144 , c145 , c150 , c151 ,
  c152 , c153 , c154 , c155 ,
  c200 , c201 , c202 , c203 ,
  c204 , c205 , c210 , c211 ,
  c212 , c213 , c214 , c215 ,
  c220 , c221 , c222 , c223 ,
  c224 , c225 , c230 , c231 ,
  c232 , c233 , c234 , c235 ,
  c240 , c241 , c242 , c243 ,
  c244 , c245 , c250 , c251 ,
  c252 , c253 , c254 , c255 ,
  c300 , c301 , c302 , c303 ,
  c304 , c305 , c310 , c311 ,
  c312 , c313 , c314 , c315 ,
  c320 , c321 , c322 , c323 ,
  c324 , c325 , c330 , c331 ,
  c332 , c333 , c334 , c335 ,
  c340 , c341 , c342 , c343 ,
  c344 , c345 , c350 , c351 ,
  c352 , c353 , c354 , c355 ,
  c400 , c401 , c402 , c403 ,
  c404 , c405 , c410 , c411 ,
  c412 , c413 , c414 , c415 ,
  c420 , c421 , c422 , c423 ,
  c424 , c425 , c430 , c431 ,
  c432 , c433 , c434 , c435 ,
  c440 , c441 , c442 , c443 ,
  c444 , c445 , c450 , c451 ,
  c452 , c453 , c454 , c455 ,
  c500 , c501 , c502 , c503 ,
  c504 , c505 , c510 , c511 ,
  c512 , c513 , c514 , c515 ,
  c520 , c521 , c522 , c523 ,
  c524 , c525 , c530 , c531 ,
  c532 , c533 , c534 , c535 ,
  c540 , c541 , c542 , c543 ,
  c544 , c545 , c550 , c551 ,
  c552 , c553 , c554 , c555 ,
  cTransparent
}
 All 216 possible colors, named like cRGB. More...
 

Variables

const uint16_t paletteColors []
 The 16-bit color values for paletteColor_t to actually draw to the TFT.
 

Enumeration Type Documentation

◆ paletteColor_t

All 216 possible colors, named like cRGB.

Enumerator
c000 

r = 0, g = 0, b = 0

c001 

r = 0, g = 0, b = 1

c002 

r = 0, g = 0, b = 2

c003 

r = 0, g = 0, b = 3

c004 

r = 0, g = 0, b = 4

c005 

r = 0, g = 0, b = 5

c010 

r = 0, g = 1, b = 0

c011 

r = 0, g = 1, b = 1

c012 

r = 0, g = 1, b = 2

c013 

r = 0, g = 1, b = 3

c014 

r = 0, g = 1, b = 4

c015 

r = 0, g = 1, b = 5

c020 

r = 0, g = 2, b = 0

c021 

r = 0, g = 2, b = 1

c022 

r = 0, g = 2, b = 2

c023 

r = 0, g = 2, b = 3

c024 

r = 0, g = 2, b = 4

c025 

r = 0, g = 2, b = 5

c030 

r = 0, g = 3, b = 0

c031 

r = 0, g = 3, b = 1

c032 

r = 0, g = 3, b = 2

c033 

r = 0, g = 3, b = 3

c034 

r = 0, g = 3, b = 4

c035 

r = 0, g = 3, b = 5

c040 

r = 0, g = 4, b = 0

c041 

r = 0, g = 4, b = 1

c042 

r = 0, g = 4, b = 2

c043 

r = 0, g = 4, b = 3

c044 

r = 0, g = 4, b = 4

c045 

r = 0, g = 4, b = 5

c050 

r = 0, g = 5, b = 0

c051 

r = 0, g = 5, b = 1

c052 

r = 0, g = 5, b = 2

c053 

r = 0, g = 5, b = 3

c054 

r = 0, g = 5, b = 4

c055 

r = 0, g = 5, b = 5

c100 

r = 1, g = 0, b = 0

c101 

r = 1, g = 0, b = 1

c102 

r = 1, g = 0, b = 2

c103 

r = 1, g = 0, b = 3

c104 

r = 1, g = 0, b = 4

c105 

r = 1, g = 0, b = 5

c110 

r = 1, g = 1, b = 0

c111 

r = 1, g = 1, b = 1

c112 

r = 1, g = 1, b = 2

c113 

r = 1, g = 1, b = 3

c114 

r = 1, g = 1, b = 4

c115 

r = 1, g = 1, b = 5

c120 

r = 1, g = 2, b = 0

c121 

r = 1, g = 2, b = 1

c122 

r = 1, g = 2, b = 2

c123 

r = 1, g = 2, b = 3

c124 

r = 1, g = 2, b = 4

c125 

r = 1, g = 2, b = 5

c130 

r = 1, g = 3, b = 0

c131 

r = 1, g = 3, b = 1

c132 

r = 1, g = 3, b = 2

c133 

r = 1, g = 3, b = 3

c134 

r = 1, g = 3, b = 4

c135 

r = 1, g = 3, b = 5

c140 

r = 1, g = 4, b = 0

c141 

r = 1, g = 4, b = 1

c142 

r = 1, g = 4, b = 2

c143 

r = 1, g = 4, b = 3

c144 

r = 1, g = 4, b = 4

c145 

r = 1, g = 4, b = 5

c150 

r = 1, g = 5, b = 0

c151 

r = 1, g = 5, b = 1

c152 

r = 1, g = 5, b = 2

c153 

r = 1, g = 5, b = 3

c154 

r = 1, g = 5, b = 4

c155 

r = 1, g = 5, b = 5

c200 

r = 2, g = 0, b = 0

c201 

r = 2, g = 0, b = 1

c202 

r = 2, g = 0, b = 2

c203 

r = 2, g = 0, b = 3

c204 

r = 2, g = 0, b = 4

c205 

r = 2, g = 0, b = 5

c210 

r = 2, g = 1, b = 0

c211 

r = 2, g = 1, b = 1

c212 

r = 2, g = 1, b = 2

c213 

r = 2, g = 1, b = 3

c214 

r = 2, g = 1, b = 4

c215 

r = 2, g = 1, b = 5

c220 

r = 2, g = 2, b = 0

c221 

r = 2, g = 2, b = 1

c222 

r = 2, g = 2, b = 2

c223 

r = 2, g = 2, b = 3

c224 

r = 2, g = 2, b = 4

c225 

r = 2, g = 2, b = 5

c230 

r = 2, g = 3, b = 0

c231 

r = 2, g = 3, b = 1

c232 

r = 2, g = 3, b = 2

c233 

r = 2, g = 3, b = 3

c234 

r = 2, g = 3, b = 4

c235 

r = 2, g = 3, b = 5

c240 

r = 2, g = 4, b = 0

c241 

r = 2, g = 4, b = 1

c242 

r = 2, g = 4, b = 2

c243 

r = 2, g = 4, b = 3

c244 

r = 2, g = 4, b = 4

c245 

r = 2, g = 4, b = 5

c250 

r = 2, g = 5, b = 0

c251 

r = 2, g = 5, b = 1

c252 

r = 2, g = 5, b = 2

c253 

r = 2, g = 5, b = 3

c254 

r = 2, g = 5, b = 4

c255 

r = 2, g = 5, b = 5

c300 

r = 3, g = 0, b = 0

c301 

r = 3, g = 0, b = 1

c302 

r = 3, g = 0, b = 2

c303 

r = 3, g = 0, b = 3

c304 

r = 3, g = 0, b = 4

c305 

r = 3, g = 0, b = 5

c310 

r = 3, g = 1, b = 0

c311 

r = 3, g = 1, b = 1

c312 

r = 3, g = 1, b = 2

c313 

r = 3, g = 1, b = 3

c314 

r = 3, g = 1, b = 4

c315 

r = 3, g = 1, b = 5

c320 

r = 3, g = 2, b = 0

c321 

r = 3, g = 2, b = 1

c322 

r = 3, g = 2, b = 2

c323 

r = 3, g = 2, b = 3

c324 

r = 3, g = 2, b = 4

c325 

r = 3, g = 2, b = 5

c330 

r = 3, g = 3, b = 0

c331 

r = 3, g = 3, b = 1

c332 

r = 3, g = 3, b = 2

c333 

r = 3, g = 3, b = 3

c334 

r = 3, g = 3, b = 4

c335 

r = 3, g = 3, b = 5

c340 

r = 3, g = 4, b = 0

c341 

r = 3, g = 4, b = 1

c342 

r = 3, g = 4, b = 2

c343 

r = 3, g = 4, b = 3

c344 

r = 3, g = 4, b = 4

c345 

r = 3, g = 4, b = 5

c350 

r = 3, g = 5, b = 0

c351 

r = 3, g = 5, b = 1

c352 

r = 3, g = 5, b = 2

c353 

r = 3, g = 5, b = 3

c354 

r = 3, g = 5, b = 4

c355 

r = 3, g = 5, b = 5

c400 

r = 4, g = 0, b = 0

c401 

r = 4, g = 0, b = 1

c402 

r = 4, g = 0, b = 2

c403 

r = 4, g = 0, b = 3

c404 

r = 4, g = 0, b = 4

c405 

r = 4, g = 0, b = 5

c410 

r = 4, g = 1, b = 0

c411 

r = 4, g = 1, b = 1

c412 

r = 4, g = 1, b = 2

c413 

r = 4, g = 1, b = 3

c414 

r = 4, g = 1, b = 4

c415 

r = 4, g = 1, b = 5

c420 

r = 4, g = 2, b = 0

c421 

r = 4, g = 2, b = 1

c422 

r = 4, g = 2, b = 2

c423 

r = 4, g = 2, b = 3

c424 

r = 4, g = 2, b = 4

c425 

r = 4, g = 2, b = 5

c430 

r = 4, g = 3, b = 0

c431 

r = 4, g = 3, b = 1

c432 

r = 4, g = 3, b = 2

c433 

r = 4, g = 3, b = 3

c434 

r = 4, g = 3, b = 4

c435 

r = 4, g = 3, b = 5

c440 

r = 4, g = 4, b = 0

c441 

r = 4, g = 4, b = 1

c442 

r = 4, g = 4, b = 2

c443 

r = 4, g = 4, b = 3

c444 

r = 4, g = 4, b = 4

c445 

r = 4, g = 4, b = 5

c450 

r = 4, g = 5, b = 0

c451 

r = 4, g = 5, b = 1

c452 

r = 4, g = 5, b = 2

c453 

r = 4, g = 5, b = 3

c454 

r = 4, g = 5, b = 4

c455 

r = 4, g = 5, b = 5

c500 

r = 5, g = 0, b = 0

c501 

r = 5, g = 0, b = 1

c502 

r = 5, g = 0, b = 2

c503 

r = 5, g = 0, b = 3

c504 

r = 5, g = 0, b = 4

c505 

r = 5, g = 0, b = 5

c510 

r = 5, g = 1, b = 0

c511 

r = 5, g = 1, b = 1

c512 

r = 5, g = 1, b = 2

c513 

r = 5, g = 1, b = 3

c514 

r = 5, g = 1, b = 4

c515 

r = 5, g = 1, b = 5

c520 

r = 5, g = 2, b = 0

c521 

r = 5, g = 2, b = 1

c522 

r = 5, g = 2, b = 2

c523 

r = 5, g = 2, b = 3

c524 

r = 5, g = 2, b = 4

c525 

r = 5, g = 2, b = 5

c530 

r = 5, g = 3, b = 0

c531 

r = 5, g = 3, b = 1

c532 

r = 5, g = 3, b = 2

c533 

r = 5, g = 3, b = 3

c534 

r = 5, g = 3, b = 4

c535 

r = 5, g = 3, b = 5

c540 

r = 5, g = 4, b = 0

c541 

r = 5, g = 4, b = 1

c542 

r = 5, g = 4, b = 2

c543 

r = 5, g = 4, b = 3

c544 

r = 5, g = 4, b = 4

c545 

r = 5, g = 4, b = 5

c550 

r = 5, g = 5, b = 0

c551 

r = 5, g = 5, b = 1

c552 

r = 5, g = 5, b = 2

c553 

r = 5, g = 5, b = 3

c554 

r = 5, g = 5, b = 4

c555 

r = 5, g = 5, b = 5

cTransparent 

Transparent, will not draw over other pixels.

Variable Documentation

◆ paletteColors

const uint16_t paletteColors[]
extern

The 16-bit color values for paletteColor_t to actually draw to the TFT.

Each 16 bit value is rrrrrggggggbbbbb, but it's in LSB order, so it's actually gggbbbbbrrrrrggg