use super::super::super::widget::image;
use vek::Rgba;
#[derive(Clone, Copy)]
pub enum Border {
DoubleCornerless {
inner: Rgba<u8>,
outer: Rgba<u8>,
},
Image {
corner: image::Handle,
edge: image::Handle,
},
None,
}
#[derive(Clone, Copy)]
pub enum Style {
Image(image::Handle, Rgba<u8>),
Color(Rgba<u8>, Border),
None,
}
impl Style {
pub fn image(image: image::Handle) -> Self { Self::Image(image, Rgba::broadcast(255)) }
pub fn color(color: Rgba<u8>) -> Self { Self::Color(color, Border::None) }
pub fn color_with_double_cornerless_border(
color: Rgba<u8>,
inner: Rgba<u8>,
outer: Rgba<u8>,
) -> Self {
Self::Color(color, Border::DoubleCornerless { inner, outer })
}
pub fn color_with_image_border(
color: Rgba<u8>,
corner: image::Handle,
edge: image::Handle,
) -> Self {
Self::Color(color, Border::Image { corner, edge })
}
}
impl Default for Style {
fn default() -> Self { Self::None }
}