lichtung-plot 0.2.0

Strongly typed scientific plotting with deterministic SVG and PNG output
Documentation
//! Scientific color and opacity encodings.

use crate::{Color, NumericValues};

/// A complete authored color source: one fixed paint or aligned numeric values.
#[derive(Debug, Clone)]
#[non_exhaustive]
pub enum ColorSource {
    /// A fixed complete color, with no data-scale or guide.
    Fixed(Color),
    /// Numeric observations to be mapped through a continuous scale.
    Numeric(NumericValues),
}

impl From<Color> for ColorSource {
    fn from(color: Color) -> Self {
        Self::Fixed(color)
    }
}

impl From<NumericValues> for ColorSource {
    fn from(values: NumericValues) -> Self {
        Self::Numeric(values)
    }
}

pub use crate::alpha::{AlphaEncoding, AlphaMapping, AlphaSemantics, AlphaValues};
pub use crate::spec::CategoricalColorMap;
pub use crate::theme::scale_values::{
    AccentPalette, CategoricalColorScale, ColorDomain, ColorStop, ContinuousColorScale,
    ContinuousScaleKind, DivergingGradient, PaletteCapacity, QualitativePalette,
    SequentialGradient,
};