docx_reader/documents/elements/
shading.rsuse serde::Serialize;
use crate::types::*;
#[derive(Serialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Shading {
pub shd_type: ShdType,
pub color: String,
pub fill: String,
}
impl Default for Shading {
fn default() -> Self {
Shading {
shd_type: ShdType::Clear,
color: "auto".to_owned(),
fill: "FFFFFF".to_owned(),
}
}
}
impl Shading {
pub fn new() -> Shading {
Shading::default()
}
pub fn color(mut self, color: impl Into<String>) -> Shading {
self.color = color.into();
self
}
pub fn fill(mut self, fill: impl Into<String>) -> Shading {
self.fill = fill.into();
self
}
pub fn shd_type(mut self, shd_type: ShdType) -> Shading {
self.shd_type = shd_type;
self
}
}