pub struct ColorPalettes<'a> { /* private fields */ }Expand description
CPAL table.
The palettes for a font are available in FontFace::color_palettes.
Implementations§
Source§impl ColorPalettes<'static>
impl ColorPalettes<'static>
Sourcepub fn new<'a>(font: RawFace<'a>) -> ColorPalettes<'a>
pub fn new<'a>(font: RawFace<'a>) -> ColorPalettes<'a>
New from font.
Palettes are parsed on demand.
Source§impl<'a> ColorPalettes<'a>
impl<'a> ColorPalettes<'a>
Sourcepub fn palette(
&self,
p: impl Into<FontColorPalette>,
) -> Option<ColorPalette<'a>>
pub fn palette( &self, p: impl Into<FontColorPalette>, ) -> Option<ColorPalette<'a>>
Gets the requested palette or the first if it is not found.
Sourcepub fn palette_exact(
&self,
p: impl Into<FontColorPalette>,
) -> Option<ColorPalette<'a>>
pub fn palette_exact( &self, p: impl Into<FontColorPalette>, ) -> Option<ColorPalette<'a>>
Gets the requested palette.
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = ColorPalette<'_>>
pub fn iter(&self) -> impl ExactSizeIterator<Item = ColorPalette<'_>>
Iterate over color palettes.
Trait Implementations§
Source§impl<'a> Clone for ColorPalettes<'a>
impl<'a> Clone for ColorPalettes<'a>
Source§fn clone(&self) -> ColorPalettes<'a>
fn clone(&self) -> ColorPalettes<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ColorPalettes<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more