fj_core/operations/
presentation.rs1use fj_interop::Color;
4
5use crate::{objects::Region, storage::Handle, Core};
6
7pub trait GetColor {
9 fn get_color(&self, core: &mut Core) -> Option<Color>;
11}
12
13impl GetColor for Handle<Region> {
14 fn get_color(&self, core: &mut Core) -> Option<Color> {
15 core.layers.presentation.color.get(self).copied()
16 }
17}
18
19pub trait SetColor {
21 fn set_color(&self, color: impl Into<Color>, core: &mut Core);
23}
24
25impl SetColor for Handle<Region> {
26 fn set_color(&self, color: impl Into<Color>, core: &mut Core) {
27 core.layers
28 .presentation
29 .set_color(self.clone(), color.into());
30 }
31}