pub enum FractalPalette {
Grayscale,
Smooth {
offset: f32,
freq: f32,
},
OrbitTrap,
AngleBased,
UltraFractal,
Fire,
Electric,
}Expand description
Maps an EscapeResult to RGBA color.
Variants§
Grayscale
Classic grayscale escape time.
Smooth
Smooth gradient using a 3-cycle cosine palette.
OrbitTrap
Orbit trap: color based on closest approach to origin.
AngleBased
Angle coloring: hue = orbit angle.
UltraFractal
Ultra-fractal style: 4 stops of gradient.
Fire
Fire: black → red → orange → yellow → white.
Electric
Electric: black → deep blue → cyan → white.
Implementations§
Source§impl FractalPalette
impl FractalPalette
Sourcepub fn color(&self, result: &EscapeResult, max_iter: u32) -> Vec4
pub fn color(&self, result: &EscapeResult, max_iter: u32) -> Vec4
Convert an EscapeResult to RGBA in [0,1].
Trait Implementations§
Source§impl Clone for FractalPalette
impl Clone for FractalPalette
Source§fn clone(&self) -> FractalPalette
fn clone(&self) -> FractalPalette
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 FractalPalette
impl Debug for FractalPalette
impl Copy for FractalPalette
Auto Trait Implementations§
impl Freeze for FractalPalette
impl RefUnwindSafe for FractalPalette
impl Send for FractalPalette
impl Sync for FractalPalette
impl Unpin for FractalPalette
impl UnsafeUnpin for FractalPalette
impl UnwindSafe for FractalPalette
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.