prismatica 0.2.0

308 scientific colormaps as compile-time Rust constants
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Plotters framework integration.
//!
//! Provides [`From<Color>`](crate::Color) for [`plotters::style::RGBColor`].

use crate::{Color, IntoFrameworkColor};

/// Convert a prismatica Color to a plotters RGBColor.
impl From<Color> for ::plotters::style::RGBColor {
    fn from(c: Color) -> Self {
        ::plotters::style::RGBColor(c.r, c.g, c.b)
    }
}

impl IntoFrameworkColor<::plotters::style::RGBColor> for Color {
    fn into_framework_color(self) -> ::plotters::style::RGBColor {
        self.into()
    }
}