use crate::{color::Color, Table, TableOption};
#[cfg_attr(docsrs, doc(cfg(feature = "color")))]
#[derive(Debug, Clone, Default)]
pub struct MarginColor {
inner: papergrid::MarginColor,
}
impl MarginColor {
pub fn new(top: Color, bottom: Color, left: Color, right: Color) -> Self {
Self {
inner: papergrid::MarginColor {
bottom: bottom.into(),
left: left.into(),
right: right.into(),
top: top.into(),
},
}
}
}
impl<R> TableOption<R> for MarginColor {
fn change(&mut self, table: &mut Table<R>) {
table.get_config_mut().set_margin_color(self.inner.clone());
}
}