pub struct ColorPalette {
pub name: String,
pub entries: Vec<PaletteEntry>,
}Expand description
Color palette
Fields§
§name: StringPalette name
entries: Vec<PaletteEntry>Palette entries
Implementations§
Source§impl ColorPalette
impl ColorPalette
Sourcepub fn interpolate(&self, value: f64) -> Option<Rgb>
pub fn interpolate(&self, value: f64) -> Option<Rgb>
Interpolates a color at the given value
Sourcepub fn apply_to_grayscale(&self, data: &mut [u8]) -> WasmResult<()>
pub fn apply_to_grayscale(&self, data: &mut [u8]) -> WasmResult<()>
Applies the palette to an image
Trait Implementations§
Source§impl Clone for ColorPalette
impl Clone for ColorPalette
Source§fn clone(&self) -> ColorPalette
fn clone(&self) -> ColorPalette
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 moreSource§impl Debug for ColorPalette
impl Debug for ColorPalette
Source§impl<'de> Deserialize<'de> for ColorPalette
impl<'de> Deserialize<'de> for ColorPalette
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ColorPalette
impl RefUnwindSafe for ColorPalette
impl Send for ColorPalette
impl Sync for ColorPalette
impl Unpin for ColorPalette
impl UnsafeUnpin for ColorPalette
impl UnwindSafe for ColorPalette
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