pub struct Palette { /* private fields */ }
Implementations§
source§impl Palette
impl Palette
sourcepub fn new(capacity: usize) -> Result<Self, String>
pub fn new(capacity: usize) -> Result<Self, String>
Create a palette structure with the specified number of color entries.
The palette entries are initialized to white.
sourcepub fn with_colors(colors: &[Color]) -> Result<Self, String>
pub fn with_colors(colors: &[Color]) -> Result<Self, String>
Creates a palette from the provided colors
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Palette
impl RefUnwindSafe for Palette
impl !Send for Palette
impl !Sync for Palette
impl Unpin for Palette
impl UnwindSafe for Palette
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