pub struct Palettes<'a> {
cpal: Option<&'a Cpal<'a>>,
}Expand description
Provides access to the color palettes in a font.
Fields§
§cpal: Option<&'a Cpal<'a>>Implementations§
Source§impl<'a> Palettes<'a>
impl<'a> Palettes<'a>
Sourcepub fn len(&self) -> u32
pub fn len(&self) -> u32
Returns the number of palettes, or zero if the font has no CPAL
table.
Sourcepub fn get(&self, index: u32) -> Option<Palette<'a>>
pub fn get(&self, index: u32) -> Option<Palette<'a>>
Returns the palette at index. Index zero is the default palette.
Sourcepub fn iter(&self) -> impl Iterator<Item = Palette<'a>> + 'a
pub fn iter(&self) -> impl Iterator<Item = Palette<'a>> + 'a
Returns an iterator over the palettes, in index order.
Sourcepub fn color_label(&self, color_index: u32) -> Option<NameId>
pub fn color_label(&self, color_index: u32) -> Option<NameId>
Returns the name ID for the label of the color at color_index, if
the table has one.
The label applies to that color in every palette.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Palettes<'a>
impl<'a> RefUnwindSafe for Palettes<'a>
impl<'a> Send for Palettes<'a>
impl<'a> Sync for Palettes<'a>
impl<'a> Unpin for Palettes<'a>
impl<'a> UnsafeUnpin for Palettes<'a>
impl<'a> UnwindSafe for Palettes<'a>
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