pub struct ColourGradient {
pub colours: Vec<RGBAColour>,
pub min: f32,
pub max: f32,
}Expand description
ColourGradient allows you to create custom colour gradients for each PNG created.
Fields§
§colours: Vec<RGBAColour>§min: f32§max: f32Implementations§
Source§impl ColourGradient
impl ColourGradient
pub fn new() -> Self
pub fn create(theme: ColourTheme) -> Self
pub fn default_theme() -> Self
pub fn audacity_theme() -> Self
pub fn rainbow_theme() -> Self
pub fn black_white_theme() -> Self
pub fn white_black_theme() -> Self
pub fn light_dark_theme() -> Self
pub fn get_colour(&self, value: f32) -> RGBAColour
pub fn to_legend(&self, width: usize, height: usize) -> Vec<RGBAColour>
pub fn add_colour(&mut self, colour: RGBAColour)
pub fn set_max(&mut self, max: f32)
pub fn set_min(&mut self, min: f32)
Trait Implementations§
Source§impl Clone for ColourGradient
impl Clone for ColourGradient
Source§fn clone(&self) -> ColourGradient
fn clone(&self) -> ColourGradient
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 ColourGradient
impl Debug for ColourGradient
Auto Trait Implementations§
impl Freeze for ColourGradient
impl RefUnwindSafe for ColourGradient
impl Send for ColourGradient
impl Sync for ColourGradient
impl Unpin for ColourGradient
impl UnwindSafe for ColourGradient
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,
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