graphics_style/styles/texture/
mod.rs1use super::*;
2mod transform;
3
4pub use transform::{TextureFilter, TextureTransform, TextureWrap};
5
6#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
7pub enum Texture {
8 Color(Color),
9 Image(Image),
10 Gradient(Gradient),
11}
12
13impl From<Color> for Texture {
14 fn from(color: Color) -> Self {
15 Self::Color(color)
16 }
17}
18
19impl From<Image> for Texture {
20 fn from(image: Image) -> Self {
21 Self::Image(image)
22 }
23}
24impl From<Gradient> for Texture {
25 fn from(gradient: Gradient) -> Self {
26 Self::Gradient(gradient)
27 }
28}
29
30impl Default for Texture {
31 fn default() -> Self {
32 Self::Color(Color::new(0, 0, 0, 0))
33 }
34}