Struct quake_files::palette::Palette
[−]
[src]
pub struct Palette { /* fields omitted */ }
A palette for translating indexed colors to actual colors.
Methods
impl Palette
[src]
fn read<R>(reader: &mut R) -> QResult<Palette> where
R: Read,
R: Read,
Reads a palette from a reader and returns it.
fn write<W>(&self, writer: &mut W) -> QResult<()> where
W: Write,
W: Write,
Writes this palette to the given Write
instance.
fn from_image(image: &DynamicImage) -> QResult<Palette>
Creates a palette from an image. It returns an error if there are more than 256 colors in the image.
fn get(&self, idx: u8) -> Color
Returns the color for an index.
fn map(&self) -> &[Color]
Returns all of the colors in this palette.