mod color8;
mod colorf;
mod color16;
pub trait Color<T> {
fn r(&self) -> T;
fn g(&self) -> T;
fn b(&self) -> T;
fn a(&self) -> T;
fn gray(&self) -> T;
fn gray_alpha(&self) -> Self;
fn premultiply(&self) -> Self;
fn blend(&self, src: Self, mode: BlendMode) -> Self;
const MIN: T;
const MAX: T;
const BLACK: Self;
const WHITE: Self;
const RED: Self;
const GREEN: Self;
const BLUE: Self;
const YELLOW: Self;
const MAGENTA: Self;
const CYAN: Self;
}
#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BlendMode {
None = 0x00,
Add = 0x01,
Sub = 0x02,
Mul = 0x04,
Mod = 0x10,
Blend = 0x80,
}
#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Profile {
Gray = 0x01,
GrayAlpha,
RGB,
RGBA,
RGB555,
RGB565,
}
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Color8 {
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Color16 {
pub r: u16,
pub g: u16,
pub b: u16,
pub a: u16,
}
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ColorF {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}