pub struct IndexedPalette { /* private fields */ }Implementations§
Source§impl IndexedPalette
impl IndexedPalette
Sourcepub fn from_colors(colors: Vec<Rgb>) -> Self
pub fn from_colors(colors: Vec<Rgb>) -> Self
A palette from stored colours (scene packages), in the layout new
produces.
Sourcepub fn for_graph(graph: &SceneGraph) -> Self
pub fn for_graph(graph: &SceneGraph) -> Self
The palette a scene graph renders with: generator 4 and later give light scenes a stronger ink ramp (below); everything else keeps the original, linear one.
Sourcepub fn new(family: &PaletteFamily) -> Self
pub fn new(family: &PaletteFamily) -> Self
The original palette: ink levels blend linearly from background to ink.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn colors(&self) -> &[Rgb]
Sourcepub fn ember(band: u8, level: u8) -> u8
pub fn ember(band: u8, level: u8) -> u8
Ember entry for a background band and level 1..=LEVELS.
Sourcepub fn with_sprite_colors(self, extra: impl IntoIterator<Item = Rgb>) -> Self
pub fn with_sprite_colors(self, extra: impl IntoIterator<Item = Rgb>) -> Self
Adds sprite colours it lacks (a character drawn with colours the built-in art doesn’t use), as far as the budget allows.
Sourcepub fn sprite_index(&self, rgb: Rgb) -> Option<u8>
pub fn sprite_index(&self, rgb: Rgb) -> Option<u8>
Palette index of a sprite colour.
Trait Implementations§
Source§impl Clone for IndexedPalette
impl Clone for IndexedPalette
Source§impl Debug for IndexedPalette
impl Debug for IndexedPalette
impl Eq for IndexedPalette
Source§impl PartialEq for IndexedPalette
impl PartialEq for IndexedPalette
impl StructuralPartialEq for IndexedPalette
Auto Trait Implementations§
impl Forget for IndexedPalette
impl Freeze for IndexedPalette
impl Move for IndexedPalette
impl RefUnwindSafe for IndexedPalette
impl Send for IndexedPalette
impl Sync for IndexedPalette
impl Unpin for IndexedPalette
impl UnsafeUnpin for IndexedPalette
impl UnwindSafe for IndexedPalette
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more