pub struct AdaptiveColor {
pub light: Color,
pub dark: Color,
}Expand description
Adaptive color that depends on terminal background
Fields§
§light: ColorColor to use on light backgrounds
dark: ColorColor to use on dark backgrounds
Implementations§
Source§impl AdaptiveColor
impl AdaptiveColor
Sourcepub fn new(light: Color, dark: Color) -> AdaptiveColor
pub fn new(light: Color, dark: Color) -> AdaptiveColor
Create a new adaptive color
Sourcepub fn from_hex(light: &str, dark: &str) -> AdaptiveColor
pub fn from_hex(light: &str, dark: &str) -> AdaptiveColor
Create from hex strings
Sourcepub fn universal(color: Color) -> AdaptiveColor
pub fn universal(color: Color) -> AdaptiveColor
Create a universal adaptive color (same on both backgrounds)
Trait Implementations§
Source§impl Clone for AdaptiveColor
impl Clone for AdaptiveColor
Source§fn clone(&self) -> AdaptiveColor
fn clone(&self) -> AdaptiveColor
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 moreimpl Copy for AdaptiveColor
Source§impl Debug for AdaptiveColor
impl Debug for AdaptiveColor
Source§impl Default for AdaptiveColor
impl Default for AdaptiveColor
Source§fn default() -> AdaptiveColor
fn default() -> AdaptiveColor
Returns the “default value” for a type. Read more
impl Eq for AdaptiveColor
Source§impl From<AdaptiveColor> for Color
impl From<AdaptiveColor> for Color
Source§fn from(adaptive: AdaptiveColor) -> Color
fn from(adaptive: AdaptiveColor) -> Color
Converts to this type from the input type.
Source§impl From<Color> for AdaptiveColor
impl From<Color> for AdaptiveColor
Source§fn from(color: Color) -> AdaptiveColor
fn from(color: Color) -> AdaptiveColor
Converts to this type from the input type.
Source§impl PartialEq for AdaptiveColor
impl PartialEq for AdaptiveColor
impl StructuralPartialEq for AdaptiveColor
Auto Trait Implementations§
impl Forget for AdaptiveColor
impl Freeze for AdaptiveColor
impl Move for AdaptiveColor
impl RefUnwindSafe for AdaptiveColor
impl Send for AdaptiveColor
impl Sync for AdaptiveColor
impl Unpin for AdaptiveColor
impl UnsafeUnpin for AdaptiveColor
impl UnwindSafe for AdaptiveColor
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