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