docx_reader/documents/elements/
shading.rs

1use serde::Serialize;
2
3use crate::types::*;
4
5// INFO: Theme is not supported now.
6#[derive(Serialize, Debug, Clone, PartialEq)]
7#[serde(rename_all = "camelCase")]
8pub struct Shading {
9	pub shd_type: ShdType,
10	pub color: String,
11	pub fill: String,
12}
13
14impl Default for Shading {
15	fn default() -> Self {
16		Shading {
17			shd_type: ShdType::Clear,
18			color: "auto".to_owned(),
19			fill: "FFFFFF".to_owned(),
20		}
21	}
22}
23
24impl Shading {
25	pub fn new() -> Shading {
26		Shading::default()
27	}
28
29	pub fn color(mut self, color: impl Into<String>) -> Shading {
30		self.color = color.into();
31		self
32	}
33
34	pub fn fill(mut self, fill: impl Into<String>) -> Shading {
35		self.fill = fill.into();
36		self
37	}
38
39	pub fn shd_type(mut self, shd_type: ShdType) -> Shading {
40		self.shd_type = shd_type;
41		self
42	}
43}