ColorPalette

Struct ColorPalette 

Source
pub struct ColorPalette<'a> { /* private fields */ }
Expand description

A single color palette.

Implementations§

Source§

impl<'a> ColorPalette<'a>

Source

pub fn colors(&self) -> &[Color]

Returns the colors contained within this palette.

Source

pub fn palette_type(&self) -> Option<PaletteType>

Returns this palette’s type flags (currently, whether this palette is appropriate for use on a light and/or dark background). This may not always be present.

Source

pub fn label(&self) -> Option<StringId>

Returns this palette’s label/name, if present.

Source

pub fn index(&self) -> u16

Returns this palette’s index in the CPAL table.

Auto Trait Implementations§

§

impl<'a> Freeze for ColorPalette<'a>

§

impl<'a> RefUnwindSafe for ColorPalette<'a>

§

impl<'a> Send for ColorPalette<'a>

§

impl<'a> Sync for ColorPalette<'a>

§

impl<'a> Unpin for ColorPalette<'a>

§

impl<'a> UnwindSafe for ColorPalette<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.