Difference between revisions of "Palette"
From Sega Retro
Scarred Sun (talk | contribs) m |
|||
(23 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
+ | A '''palette''' is selection of colors which is used in an image. Rather than defining a color for each individual [[pixel]] (such as in 24-bit color images), palettes are used to link pixels to color data by way of an index reference. Graphics in [[Sega Mega Drive]], [[Master System]], [[Game Gear]] and [[Game Boy Advance]] games all use palettes. | ||
− | + | ==Mega Drive palette== | |
− | + | {{mainArticle|Sega Mega Drive/Palettes and CRAM}} | |
− | + | ==Master System palette== | |
− | + | Consists of 16 colors, each represented by eight [[bit]]s (a single byte) in the format '''00BBGGRR''', where BB = blue; GG = green; and RR = red. The BB, GG and RR can be any of the following values:[[File:Master System Palette.png|right]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Consists of 16 | ||
*00 = 0 | *00 = 0 | ||
*01 = 85 | *01 = 85 | ||
Line 27: | Line 12: | ||
As such, the highest palette value is '''00111111''', which is '''3F''' when converted to a byte. | As such, the highest palette value is '''00111111''', which is '''3F''' when converted to a byte. | ||
− | === | + | ==Game Gear palette== |
− | With 256 color indices for 4 backgrounds and 256 color indices for sprites, the [[ | + | Consists of 16 colors, each represented by two bytes (four [[nybble]]s) in the format '''GR 0B''', where G = green; R = red and B = blue. The G, R and B can be any of the following values:[[File:Game Gear Palette.png|right]] |
+ | *0/1 = 0 | ||
+ | *2/3 = 36 | ||
+ | *4/5 = 72 | ||
+ | *6/7 = 109 | ||
+ | *8/9 = 145 | ||
+ | *A/B = 182 | ||
+ | *C/D = 218 | ||
+ | *E/F = 255 | ||
+ | |||
+ | ==Game Boy Advance palette== | ||
+ | With 256 color indices for 4 backgrounds and 256 color indices for sprites, the [[Game Boy Advance]] uses the BGR555 format (15 bit colors). One color index contains two bytes (5 bits per component): '''0BBBBBGGGGGRRRRR'''. The Game Boy Advance also has support for RGB mode where one pixel on the screen is represented by the RGB value and not by an index, so you can use images with up to 32768 colors. | ||
+ | |||
+ | [[Category:Technical information]] |
Latest revision as of 17:32, 12 June 2018
A palette is selection of colors which is used in an image. Rather than defining a color for each individual pixel (such as in 24-bit color images), palettes are used to link pixels to color data by way of an index reference. Graphics in Sega Mega Drive, Master System, Game Gear and Game Boy Advance games all use palettes.
Contents
Mega Drive palette
- Main article: Sega Mega Drive/Palettes and CRAM.
Master System palette
Consists of 16 colors, each represented by eight bits (a single byte) in the format 00BBGGRR, where BB = blue; GG = green; and RR = red. The BB, GG and RR can be any of the following values:
- 00 = 0
- 01 = 85
- 10 = 170
- 11 = 255
As such, the highest palette value is 00111111, which is 3F when converted to a byte.
Game Gear palette
Consists of 16 colors, each represented by two bytes (four nybbles) in the format GR 0B, where G = green; R = red and B = blue. The G, R and B can be any of the following values:
- 0/1 = 0
- 2/3 = 36
- 4/5 = 72
- 6/7 = 109
- 8/9 = 145
- A/B = 182
- C/D = 218
- E/F = 255
Game Boy Advance palette
With 256 color indices for 4 backgrounds and 256 color indices for sprites, the Game Boy Advance uses the BGR555 format (15 bit colors). One color index contains two bytes (5 bits per component): 0BBBBBGGGGGRRRRR. The Game Boy Advance also has support for RGB mode where one pixel on the screen is represented by the RGB value and not by an index, so you can use images with up to 32768 colors.