MCPcopy Create free account
hub / github.com/emilk/egui_plot / span

Method span

egui_plot/src/plot.rs:2114–2128  ·  view source on GitHub ↗

Add an axis-aligned span. Spans fill the space between two values on one axis. If both the fill and border colors are transparent, a color is auto-assigned.

(&mut self, mut span: Span)

Source from the content-addressed store, hash-verified

2112 /// Spans fill the space between two values on one axis. If both the fill
2113 /// and border colors are transparent, a color is auto-assigned.
2114 pub fn span(&mut self, mut span: Span) {
2115 let fill_is_transparent = span.fill_color() == Color32::TRANSPARENT;
2116 let border_is_transparent = span.border_color_value() == Color32::TRANSPARENT;
2117
2118 // If no color was provided, automatically assign a color to the span
2119 if fill_is_transparent && border_is_transparent {
2120 let auto_color = self.auto_color();
2121 span = span.fill(auto_color.gamma_multiply(0.15)).border_color(auto_color);
2122 } else if border_is_transparent && !fill_is_transparent {
2123 let fill_color = span.fill_color();
2124 span = span.border_color(fill_color);
2125 }
2126
2127 self.items.push(Box::new(span));
2128 }
2129
2130 /// Add a box plot diagram.
2131 pub fn box_plot(&mut self, mut box_plot: crate::BoxPlot) {

Callers 1

show_plotMethod · 0.80

Calls 5

border_color_valueMethod · 0.80
auto_colorMethod · 0.80
border_colorMethod · 0.80
fill_colorMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected