MCPcopy Create free account
hub / github.com/alceal/plotlars / axis_value_color

Function axis_value_color

crates/plotlars-plotters/src/render/axis.rs:15–19  ·  view source on GitHub ↗

Resolve an axis's value-label color, defaulting to black when unset. Centralizes the `axis.as_ref().and_then(|a| a.value_color.as_ref()).map(convert_rgb).unwrap_or(BLACK)` chain that otherwise repeats across every renderer.

(axis: Option<&Axis>)

Source from the content-addressed store, hash-verified

13/// Centralizes the `axis.as_ref().and_then(|a| a.value_color.as_ref()).map(convert_rgb).unwrap_or(BLACK)`
14/// chain that otherwise repeats across every renderer.
15pub(super) fn axis_value_color(axis: Option<&Axis>) -> RGBColor {
16 axis.and_then(|a| a.value_color.as_ref())
17 .map(convert_rgb)
18 .unwrap_or(BLACK)
19}
20
21pub(super) fn configure_label_areas(
22 builder: &mut ChartBuilder<'_, '_, impl DrawingBackend>,

Callers 5

render_boxplotFunction · 0.85
render_bar_verticalFunction · 0.85
render_bar_horizontalFunction · 0.85
render_numericFunction · 0.85
render_heatmapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected