summaryrefslogtreecommitdiffstats
path: root/graphics/src/geometry/style.rs
blob: a0f4b08aa3e493b444a1c24ad8edb8991017a2a6 (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::core::Color;
use crate::geometry::Gradient;

/// 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)
    }
}