Skip to content

Commit

Permalink
Add GetColor
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Feb 16, 2024
1 parent d2acce9 commit 37d89ad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/fj-core/src/operations/presentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ use crate::{
Core,
};

/// Get the color of an object
pub trait GetColor {
/// Get the color of the object
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()
}
}

/// Set the color of an object
pub trait SetColor: IsObject {
/// Set the color of the object
Expand Down

0 comments on commit 37d89ad

Please sign in to comment.