iced-yoda/core/src/background.rs

22 lines
442 B
Rust
Raw Normal View History

use crate::Color;
2019-11-18 07:16:19 +01:00
/// The background of some element.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Background {
2019-11-18 07:16:19 +01:00
/// A solid color
Color(Color),
// TODO: Add gradient and image variants
}
impl From<Color> for Background {
fn from(color: Color) -> Self {
Background::Color(color)
}
}
impl From<Color> for Option<Background> {
fn from(color: Color) -> Self {
Some(Background::from(color))
}
}