hadean-zig/src/Color.zig

31 lines
655 B
Zig
Raw Normal View History

2024-08-21 16:36:46 -04:00
const Color = @This();
r: f32,
g: f32,
b: f32,
a: f32,
pub fn rgba(r: f32, g: f32, b: f32, a: f32) Color {
return .{
.r = r,
.g = g,
.b = b,
.a = a,
};
}
pub const WHITE = rgba(1, 1, 1, 1);
pub const RED = rgba(1, 0, 0, 1);
pub const ORANGE = rgba(1, 0.5, 0, 1);
pub const YELLOW = rgba(1, 1, 0, 1);
pub const LIME = rgba(0.5, 1, 0, 1);
pub const GREEN = rgba(0, 1, 0, 1);
pub const TEAL = rgba(0, 1, 0.5, 1);
pub const CYAN = rgba(0, 1, 1, 1);
pub const LIGHT_BLUE = rgba(0, 0.5, 1, 1);
pub const BLUE = rgba(0, 0, 1, 1);
pub const INDIGO = rgba(0.5, 0, 1, 1);
pub const MAGENTA = rgba(1, 0, 1, 1);
pub const HOT_PINK = rgba(1, 0, 0.5, 1);