lichtung-plot 0.3.0

Strongly typed scientific plotting with deterministic SVG and PNG output
Documentation
//! Shared mark styles and paint values.

/// Named line patterns used by all stroke roles.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[non_exhaustive]
pub enum LinePattern {
    /// Continuous stroke.
    #[default]
    Solid,
    /// Fixed `3 2` dash and gap lengths.
    ShortDash,
    /// Fixed `4 3` dash and gap lengths.
    MediumDash,
    /// Fixed `5 3` dash and gap lengths.
    Dashed,
}

impl LinePattern {
    pub(crate) const fn svg_dasharray(self) -> Option<&'static str> {
        match self {
            Self::Solid => None,
            Self::ShortDash => Some("3 2"),
            Self::MediumDash => Some("4 3"),
            Self::Dashed => Some("5 3"),
        }
    }
}

pub use crate::spec::PointShape;
pub use crate::theme::paint::OpaqueColor;