pub enum Theme {
ClassicGreen,
Amber,
Cyan,
Red,
Rainbow,
Custom(ColorRamp),
}Expand description
Color theme controlling the trail gradient.
Each variant resolves to a 5-stop ColorRamp. Used by the widget’s
renderer; the actual rendering tier (smooth interpolation, nearest-of-5
quantization, or 3-zone named-color collapse) is picked separately based
on detected terminal color depth — see the crate-level docs.
§Example
use matrix_rain::{MatrixConfig, Theme};
let cfg = MatrixConfig::builder().theme(Theme::Amber).build().unwrap();
assert!(matches!(cfg.theme, Theme::Amber));Variants§
ClassicGreen
White head over a green trail. The canonical Matrix look.
Stops: 0xFFFFFF → 0xCCFFCC → 0x00FF00 → 0x009900 → 0x003300.
Amber
White head over a warm amber trail.
Cyan
White head over a cyan trail.
Red
White head over a red trail.
Rainbow
White head with a rainbow trail (red → yellow → green → blue). Most visually distinctive on truecolor terminals; collapses to adjacent named colors on lower tiers.
Custom(ColorRamp)
User-supplied 5-stop ramp.
Trait Implementations§
impl Eq for Theme
impl StructuralPartialEq for Theme
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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