pub struct ColorPalettes<'a> { /* private fields */ }Expand description
Collection of color palettes for color glyphs.
Implementations§
Source§impl<'a> ColorPalettes<'a>
impl<'a> ColorPalettes<'a>
Sourcepub fn new(font: &FontRef<'a>) -> Self
pub fn new(font: &FontRef<'a>) -> Self
Creates a new collection of color palettes for the given font.
Sourcepub fn len(&self) -> u16
pub fn len(&self) -> u16
Returns the total number of palettes in this collection (0 if this collection’s font has no CPAL table).
Sourcepub fn get(&self, index: u16) -> Option<ColorPalette<'_>>
pub fn get(&self, index: u16) -> Option<ColorPalette<'_>>
Returns the color palette at the given index. The palette at index 0 is the default palette.
Sourcepub fn color_label(&self, color_index: u16) -> Option<StringId>
pub fn color_label(&self, color_index: u16) -> Option<StringId>
Returns the label/name for a given color, if present (labels are per-color, but shared across all palettes).
Auto Trait Implementations§
impl<'a> Freeze for ColorPalettes<'a>
impl<'a> RefUnwindSafe for ColorPalettes<'a>
impl<'a> Send for ColorPalettes<'a>
impl<'a> Sync for ColorPalettes<'a>
impl<'a> Unpin for ColorPalettes<'a>
impl<'a> UnwindSafe for ColorPalettes<'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