Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 0 additions & 94 deletions egui_node_graph/src/color_hex_utils.rs

This file was deleted.

21 changes: 10 additions & 11 deletions egui_node_graph/src/editor_ui.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::collections::HashSet;

use crate::color_hex_utils::*;
use crate::utils::ColorUtils;

use super::*;
Expand Down Expand Up @@ -593,11 +592,11 @@ where
let background_color;
let text_color;
if ui.visuals().dark_mode {
background_color = color_from_hex("#3f3f3f").unwrap();
text_color = color_from_hex("#fefefe").unwrap();
background_color = Color32::from_hex("#3f3f3f").unwrap();
text_color = Color32::from_hex("#fefefe").unwrap();
} else {
background_color = color_from_hex("#ffffff").unwrap();
text_color = color_from_hex("#505050").unwrap();
background_color = Color32::from_hex("#ffffff").unwrap();
text_color = Color32::from_hex("#505050").unwrap();
}

ui.visuals_mut().widgets.noninteractive.fg_stroke =
Expand Down Expand Up @@ -1013,22 +1012,22 @@ where
let dark_mode = ui.visuals().dark_mode;
let color = if resp.clicked() {
if dark_mode {
color_from_hex("#ffffff").unwrap()
Color32::from_hex("#ffffff").unwrap()
} else {
color_from_hex("#000000").unwrap()
Color32::from_hex("#000000").unwrap()
}
} else if resp.hovered() {
if dark_mode {
color_from_hex("#dddddd").unwrap()
Color32::from_hex("#dddddd").unwrap()
} else {
color_from_hex("#222222").unwrap()
Color32::from_hex("#222222").unwrap()
}
} else {
#[allow(clippy::collapsible_else_if)]
if dark_mode {
color_from_hex("#aaaaaa").unwrap()
Color32::from_hex("#aaaaaa").unwrap()
} else {
color_from_hex("#555555").unwrap()
Color32::from_hex("#555555").unwrap()
}
};
let stroke = Stroke {
Expand Down
1 change: 0 additions & 1 deletion egui_node_graph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ pub use traits::*;

mod utils;

mod color_hex_utils;
mod scale;
10 changes: 5 additions & 5 deletions egui_node_graph/src/node_finder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::BTreeMap, marker::PhantomData};

use crate::{color_hex_utils::*, CategoryTrait, NodeTemplateIter, NodeTemplateTrait};
use crate::{CategoryTrait, NodeTemplateIter, NodeTemplateTrait};

use egui::*;

Expand Down Expand Up @@ -42,11 +42,11 @@ where
let text_color;

if ui.visuals().dark_mode {
background_color = color_from_hex("#3f3f3f").unwrap();
text_color = color_from_hex("#fefefe").unwrap();
background_color = Color32::from_hex("#3f3f3f").unwrap();
text_color = Color32::from_hex("#fefefe").unwrap();
} else {
background_color = color_from_hex("#fefefe").unwrap();
text_color = color_from_hex("#3f3f3f").unwrap();
background_color = Color32::from_hex("#fefefe").unwrap();
text_color = Color32::from_hex("#3f3f3f").unwrap();
}

ui.visuals_mut().widgets.noninteractive.fg_stroke = Stroke::new(2.0, text_color);
Expand Down