#[derive(Debug, Clone, Copy)]
pub struct GlwColorPalette {
pub area_outline: image::Rgba<u8>,
pub circle_outline: image::Rgba<u8>,
pub margin_outline: image::Rgba<u8>,
pub wind_arrow: image::Rgba<u8>,
pub current_arrow: image::Rgba<u8>,
pub wave_glyph: image::Rgba<u8>,
pub center_marker: image::Rgba<u8>,
pub label_fg: image::Rgba<u8>,
pub label_shadow: image::Rgba<u8>,
pub area_fill: Option<image::Rgba<u8>>,
pub legend_bg: image::Rgba<u8>,
pub legend_fg: image::Rgba<u8>,
}
impl Default for GlwColorPalette {
fn default() -> Self {
Self {
area_outline: image::Rgba([40, 220, 40, 255]),
circle_outline: image::Rgba([40, 220, 40, 255]),
margin_outline: image::Rgba([40, 220, 40, 96]),
wind_arrow: image::Rgba([255, 255, 255, 240]),
current_arrow: image::Rgba([255, 255, 255, 200]),
wave_glyph: image::Rgba([255, 255, 255, 220]),
center_marker: image::Rgba([255, 255, 255, 200]),
label_fg: image::Rgba([255, 255, 255, 255]),
label_shadow: image::Rgba([0, 0, 0, 180]),
area_fill: None,
legend_bg: image::Rgba([0, 0, 0, 180]),
legend_fg: image::Rgba([255, 255, 255, 240]),
}
}
}
#[expect(
clippy::module_name_repetitions,
reason = "GlwStyle is the primary public type of this module"
)]
#[expect(
clippy::struct_excessive_bools,
reason = "each flag controls an independent render element; collapsing into a state machine would obscure intent"
)]
#[derive(Debug, Clone)]
pub struct GlwStyle {
pub palette: GlwColorPalette,
pub arrow_pixels_per_knot: f32,
pub min_arrow_pixels: f32,
pub arrow_thickness_pixels: f32,
pub label_overrides: bool,
pub label_font_px: f32,
pub legend_position: Option<sl_map_apis::coverage::PlacementSlot>,
pub draw_margin_band: bool,
pub margin_dash_pixels: f32,
pub margin_gap_pixels: f32,
pub draw_waves: bool,
pub draw_currents: bool,
pub area_arrow_density: u8,
}
impl Default for GlwStyle {
fn default() -> Self {
Self {
palette: GlwColorPalette::default(),
arrow_pixels_per_knot: 3.0,
min_arrow_pixels: 16.0,
arrow_thickness_pixels: 6.0,
label_overrides: true,
label_font_px: 14.0,
legend_position: None,
draw_margin_band: false,
margin_dash_pixels: 6.0,
margin_gap_pixels: 4.0,
draw_waves: true,
draw_currents: true,
area_arrow_density: 2,
}
}
}