Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions base/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,6 @@ pub(crate) mod xkcd;

pub use css4::*;

pub trait ResolveColor<Color> {
fn resolve_color(&self, color: &Color) -> Rgba8;
}

pub trait Color: Clone + Copy {
#[inline]
fn resolve<R>(&self, rc: &R) -> Rgba8
where
R: ResolveColor<Self>,
Self: Sized,
{
rc.resolve_color(self)
}
}

impl Color for Rgba8 {}

impl ResolveColor<Rgba8> for () {
fn resolve_color(&self, color: &Rgba8) -> Rgba8 {
*color
}
}

/// A simple color type with 8-bit RGB components, including an alpha channel.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Rgba8(u8, u8, u8, u8);
Expand Down
6 changes: 4 additions & 2 deletions base/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
pub mod color;
pub use color::{Color, ResolveColor, Rgb8, Rgba8};
pub use color::{Rgb8, Rgba8};

pub mod geom;

#[cfg(feature = "serde")]
mod sd;
pub mod sd;

pub mod style;
Loading
Loading