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