pub enum Background {
None,
Color(Color),
}Expand description
Widget background fill.
Possible values are no fill and a solid Background::Color.
§Examples
use ailloli_ui_core::style::{Background, Color};
assert!(Background::color(Color::WHITE).is_visible());Variants§
Implementations§
Source§impl Background
impl Background
Sourcepub fn color(color: Color) -> Self
pub fn color(color: Color) -> Self
Creates a solid color background.
§Examples
use ailloli_ui_core::style::{Background, Color};
assert_eq!(Background::color(Color::BLACK), Background::Color(Color::BLACK));Sourcepub fn is_visible(self) -> bool
pub fn is_visible(self) -> bool
Returns true when the variant carries a color.
This reports configuration presence, not effective opacity: a fully
transparent Color still returns true.
§Examples
use ailloli_ui_core::style::{Background, Color};
assert!(Background::color(Color::TRANSPARENT).is_visible());
assert!(!Background::None.is_visible());Trait Implementations§
Source§impl Clone for Background
impl Clone for Background
Source§fn clone(&self) -> Background
fn clone(&self) -> Background
Returns a copy 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 Background
impl Debug for Background
Source§impl Default for Background
impl Default for Background
Source§fn default() -> Background
fn default() -> Background
Returns the “default value” for a type. Read more
Source§impl PartialEq for Background
impl PartialEq for Background
impl Copy for Background
impl StructuralPartialEq for Background
Auto Trait Implementations§
impl Freeze for Background
impl RefUnwindSafe for Background
impl Send for Background
impl Sync for Background
impl Unpin for Background
impl UnwindSafe for Background
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