-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement custom ruler color for Plot #47
Conversation
This should work, the current implementation doesn't support setting the color BUT it works with light and dark mode - your implementation doesn't work with light and dark mode as it is always the same color egui_plot/egui_plot/src/items/mod.rs Line 1939 in 0fe0ea6
|
@bircni I'm not quite sure what you are trying to say. // before
let line_color = rulers_color(ui);
// now
let line_color = self.ruler_color.unwrap_or_else(|| rulers_color(ui)); |
Sure I wanted to say that it might be better to set two colors, one for dark and one for light. |
That seems really unnecessary to me. let my_color = if ui.visuals().dark_mode { Color32::RED } else { Color32::GREEN };
egui_plot::Plot::new("my_plot").custom_ruler_color(my_color).show( [...] ) |
@emilk this seems to be ready to merge |
Implement custom ruler color for Plot which is exposed through the new
custom_ruler_color
method. The entire thing is only a few lines.