22 lines
609 B
Rust
22 lines
609 B
Rust
use crate::*;
|
|
|
|
macro_rules! hex {
|
|
( $value:literal ) => {
|
|
image::SRGBA {
|
|
r: (($value >> 16) & 0xff) as f32 / 255.0,
|
|
g: (($value >> 8) & 0xff) as f32 / 255.0,
|
|
b: ($value & 0xff) as f32 / 255.0,
|
|
a: 1.0,
|
|
}
|
|
}
|
|
}
|
|
|
|
pub const BLACK: image::SRGBA = hex!(0x000000);
|
|
pub const RED: image::SRGBA = hex!(0xff0000);
|
|
pub const GREEN: image::SRGBA = hex!(0x00ff00);
|
|
pub const BLUE: image::SRGBA = hex!(0x0000ff);
|
|
pub const CYAN: image::SRGBA = hex!(0x00ffff);
|
|
pub const MAGENTA: image::SRGBA = hex!(0xff00ff);
|
|
pub const YELLOW: image::SRGBA = hex!(0xffff00);
|
|
pub const WHITE: image::SRGBA = hex!(0xffffff);
|