summaryrefslogtreecommitdiffstats
path: root/graphics/src/geometry/style.rs
blob: ece6b32a293856931c0111d03ae4557b11cc26bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::Gradient;
use iced_core::Color;

/// The coloring style of some drawing.
#[derive(Debug, Clone, PartialEq)]
pub enum Style {
    /// A solid [`Color`].
    Solid(Color),

    /// A [`Gradient`] color.
    Gradient(Gradient),
}

impl From<Color> for Style {
    fn from(color: Color) -> Self {
        Self::Solid(color)
    }
}

impl From<Gradient> for Style {
    fn from(gradient: Gradient) -> Self {
        Self::Gradient(gradient)
    }
}