mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Implement update_colors (#43)
Co-authored-by: RustyNixieTube <RustyNixieTube@users.noreply.github.com>
This commit is contained in:
committed by
Keavon Chambers
parent
543fc4fec1
commit
e4073a112f
@@ -24,5 +24,7 @@ pub fn on_mouse_move(x: u32, y: u32) {
|
||||
/// Update working colors
|
||||
#[wasm_bindgen]
|
||||
pub fn update_colors(primary_color: Color, secondary_color: Color) {
|
||||
todo!()
|
||||
let tool_state = unsafe { &mut TOOL_STATE };
|
||||
tool_state.set_primary_color(primary_color.get_inner_color());
|
||||
tool_state.set_secondary_color(secondary_color.get_inner_color());
|
||||
}
|
||||
|
||||
@@ -13,6 +13,12 @@ impl Color {
|
||||
}
|
||||
}
|
||||
|
||||
impl Color {
|
||||
pub fn get_inner_color(&self) -> InnerColor {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
pub fn translate_tool(name: &str) -> Option<ToolType> {
|
||||
match name {
|
||||
"Select" => Some(ToolType::Select),
|
||||
|
||||
Reference in New Issue
Block a user