Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
component:gpu [2017/03/27 23:55]
payonel [Palette Color]
component:gpu [2017/03/28 05:23]
payonel
Line 68: Line 68:
  
 GPU Color Depth GPU Color Depth
------------+==============
  
 Color Depth (see `gpu.setDepth` and `gpu.getDepth`) can be 1, 4, or 8 bits separately for foreground and background. These depths provide 2, 16, and 256 colors respectively. Color Depth (see `gpu.setDepth` and `gpu.getDepth`) can be 1, 4, or 8 bits separately for foreground and background. These depths provide 2, 16, and 256 colors respectively.
Line 75: Line 75:
  
 RGB Color RGB Color
-============+-----------
 The background and foreground colors, as set by calling `setBackground` and `setForeground`,​ are defined by a `value` (number) and `is_palette` (boolean) pair (the boolean being optional). The background and foreground colors, as set by calling `setBackground` and `setForeground`,​ are defined by a `value` (number) and `is_palette` (boolean) pair (the boolean being optional).
  
Line 85: Line 85:
  
 Palette Color Palette Color
-============+-----------
 When `is_palette` is `true`, `value` is interpreted as palette index [0, 16). If you switch from a higher bit density to monochrome note that the color value from the palette is used to determine zero vs the nonzero monochrome color. It is an error to specify a paletted color (i.e. an index value and `true`) in 1 bit depth. When `is_palette` is `true`, `value` is interpreted as palette index [0, 16). If you switch from a higher bit density to monochrome note that the color value from the palette is used to determine zero vs the nonzero monochrome color. It is an error to specify a paletted color (i.e. an index value and `true`) in 1 bit depth.
  
 Changing Depth Changing Depth
-============+-----------
  
 Note that the original color pair (the value `number` and palette `bool`) are preserved (background and foreground each) even when switching bit depths. The actual rendering on the screen will update to respect the new depth, but the original 24bit rgb value (or palette index) is not lost. For example, calling `gpu.getBackground` while in 1 bit mode will return the original 24 bit rgb value specified from any previous color depth. Note that the original color pair (the value `number` and palette `bool`) are preserved (background and foreground each) even when switching bit depths. The actual rendering on the screen will update to respect the new depth, but the original 24bit rgb value (or palette index) is not lost. For example, calling `gpu.getBackground` while in 1 bit mode will return the original 24 bit rgb value specified from any previous color depth.