Trait spectrusty::video::pixel::Palette
source · pub trait Palette {
type Pixel: Copy;
fn get_pixel_gray(index: u8) -> Self::Pixel;
fn get_pixel_grb8(g3r3b2: u8) -> Self::Pixel;
fn get_pixel_gray8(value: u8) -> Self::Pixel;
fn get_pixel(index: u8) -> Self::Pixel { ... }
}
Expand description
A trait used for obtaining pixel colors.
Required Associated Types§
Required Methods§
sourcefn get_pixel_gray(index: u8) -> Self::Pixel
fn get_pixel_gray(index: u8) -> Self::Pixel
Should return a grayscale pixel with the intensity of one of the ZX Spectrum colors: [0, 15].
See Palette::get_pixel for color values.
sourcefn get_pixel_grb8(g3r3b2: u8) -> Self::Pixel
fn get_pixel_grb8(g3r3b2: u8) -> Self::Pixel
Should return one of ULAplus colors.
sourcefn get_pixel_gray8(value: u8) -> Self::Pixel
fn get_pixel_gray8(value: u8) -> Self::Pixel
Should return a grayscale pixel (0 - black, 255 - full intensity white).
Provided Methods§
sourcefn get_pixel(index: u8) -> Self::Pixel
fn get_pixel(index: u8) -> Self::Pixel
Should return one of ZX Spectrum pixel colors:
index color index color
0 - black 8 - bright black (same as black)
1 - blue 9 - bright blue
2 - red 10 - bright red
3 - magenta 11 - bright magenta
4 - green 12 - bright green
5 - cyan 13 - bright cyan
6 - yellow 14 - bright yellow
7 - white 15 - bright white