pub enum PaletteConfig {
Named(NamedPalette),
Custom(Vec<(f32, Rgb)>),
}Expand description
A validated, ready-to-bake palette selection from a preset’s [palette]
table — constructed at the load boundary (schema.rs), then trusted by
Palette::bake (validate-at-the-boundary).
Variants§
Named(NamedPalette)
A built-in named palette.
Custom(Vec<(f32, Rgb)>)
Custom gradient stops ((at, color)), pre-validated at the load boundary:
sorted at in 0..=1, ≥2 entries, parseable colors. Baked through the
same stop path the named stop-list palettes use.
Implementations§
Source§impl PaletteConfig
impl PaletteConfig
Sourcepub fn default_spectrum() -> Self
pub fn default_spectrum() -> Self
The default when a preset declares no [palette] — the exact current
cosine, so shipped presets are unchanged.
Trait Implementations§
Source§impl Clone for PaletteConfig
impl Clone for PaletteConfig
Source§fn clone(&self) -> PaletteConfig
fn clone(&self) -> PaletteConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PaletteConfig
impl RefUnwindSafe for PaletteConfig
impl Send for PaletteConfig
impl Sync for PaletteConfig
impl Unpin for PaletteConfig
impl UnsafeUnpin for PaletteConfig
impl UnwindSafe for PaletteConfig
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