Add Color trait

This commit is contained in:
Joscha 2024-03-04 23:46:47 +01:00
parent fd1b337cd1
commit 59a1235b1d
4 changed files with 166 additions and 1 deletions

View 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;
}