Add Color trait
This commit is contained in:
parent
fd1b337cd1
commit
59a1235b1d
4 changed files with 166 additions and 1 deletions
11
showbits-common/src/color.rs
Normal file
11
showbits-common/src/color.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use palette::Srgb;
|
||||
|
||||
pub trait Color: Copy {
|
||||
/// Convert to an sRGB color.
|
||||
///
|
||||
/// Useful for debugging or dithering.
|
||||
fn to_srgb(self) -> Srgb;
|
||||
|
||||
/// Combine two colors by putting one "over" the other.
|
||||
fn over(self, below: Self) -> Self;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue