Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
plotters-backend 0.0.1 - Docs.rs
[go: Go Back, main page]

plotters-backend 0.0.1

Plotters Backend API
Documentation
#[derive(Clone, Copy)]
pub struct BackendColor {
    pub alpha: f64,
    pub rgb: (u8, u8, u8),
}

impl BackendColor {
    #[inline(always)]
    pub fn mix(&self, alpha: f64) -> Self {
        Self {
            alpha: self.alpha * alpha,
            rgb: self.rgb,
        }
    }
}

/// The style data for the backend drawing API
pub trait BackendStyle {
    /// Get the color of current style
    fn color(&self) -> BackendColor;

    /// Get the stroke width of current style
    fn stroke_width(&self) -> u32 {
        1
    }
}

impl BackendStyle for BackendColor {
    fn color(&self) -> BackendColor {
        *self
    }
}