use fj_interop::Color;
use crate::{objects::Region, storage::Handle, Core};
pub trait GetColor {
fn get_color(&self, core: &mut Core) -> Option<Color>;
}
impl GetColor for Handle<Region> {
fn get_color(&self, core: &mut Core) -> Option<Color> {
core.layers.presentation.color.get(self).copied()
}
}
pub trait SetColor {
fn set_color(&self, color: impl Into<Color>, core: &mut Core);
}
impl SetColor for Handle<Region> {
fn set_color(&self, color: impl Into<Color>, core: &mut Core) {
core.layers
.presentation
.set_color(self.clone(), color.into());
}
}