[−][src]Struct fui::cursive::theme::Palette
Color configuration for the application.
Assign each color role an actual color.
It implements Index
and IndexMut
to access and modify this mapping:
Example
use cursive::theme::PaletteColor::*; use cursive::theme::Color::*; use cursive::theme::BaseColor::*; let mut palette = Palette::default(); assert_eq!(palette[Background], Dark(Blue)); palette[Shadow] = Light(Red);
Methods
impl Palette
[src]
pub fn custom(&'a self, key: &str) -> Option<&'a Color>
[src]
Returns a custom color from this palette.
Returns None
if the given key was not found.
pub fn merge(&self, namespace: &str) -> Palette
[src]
Returns a new palette where the given namespace has been merged.
All values in the namespace will override previous values.
pub fn set_color(&mut self, key: &str, color: Color)
[src]
Sets the color for the given key.
This will update either the basic palette or the custom values.
pub fn add_namespace(
&mut self,
key: &str,
namespace: HashMap<String, PaletteNode, BuildHasherDefault<FxHasher>>
)
[src]
&mut self,
key: &str,
namespace: HashMap<String, PaletteNode, BuildHasherDefault<FxHasher>>
)
Adds a color namespace to this palette.
Trait Implementations
impl IndexMut<PaletteColor> for Palette
[src]
fn index_mut(&mut self, palette_color: PaletteColor) -> &mut Color
[src]
impl Clone for Palette
[src]
fn clone(&self) -> Palette
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Palette
[src]
impl Default for Palette
[src]
Returns the default palette for a cursive application.
Background
=>Dark(Blue)
Shadow
=>Dark(Black)
View
=>Dark(White)
Primary
=>Dark(Black)
Secondary
=>Dark(Blue)
Tertiary
=>Dark(White)
TitlePrimary
=>Dark(Red)
TitleSecondary
=>Dark(Yellow)
Highlight
=>Dark(Red)
HighlightInactive
=>Dark(Blue)
impl Index<PaletteColor> for Palette
[src]
type Output = Color
The returned type after indexing.
fn index(&self, palette_color: PaletteColor) -> &Color
[src]
impl Debug for Palette
[src]
impl PartialEq<Palette> for Palette
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> With for T
[src]
fn with<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
Calls the given closure on self
.
fn try_with<E, F>(self, f: F) -> Result<Self, E> where
F: FnOnce(&mut Self) -> Result<(), E>,
[src]
F: FnOnce(&mut Self) -> Result<(), E>,
Calls the given closure on self
.
fn with_if<F>(self, condition: bool, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
Calls the given closure if condition == true
.