diff options
Diffstat (limited to 'graphics/src/geometry/style.rs')
-rw-r--r-- | graphics/src/geometry/style.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/graphics/src/geometry/style.rs b/graphics/src/geometry/style.rs new file mode 100644 index 00000000..a0f4b08a --- /dev/null +++ b/graphics/src/geometry/style.rs @@ -0,0 +1,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) + } +} |