pub const Color = struct { type: enum { Inherit, Default, RGB }, red: u8, green: u8, blue: u8, pub fn equal(self: Color, other: Color) bool { if (self.type != other.type) { return false; } if (self.type == .Default) { return true; } return self.red == other.red and self.green == other.green and self.blue == self.blue; } }; pub const Inherit = Color{ .type = .Inherit, .red = undefined, .green = undefined, .blue = undefined, }; pub const Default = Color{ .type = .Default, .red = undefined, .green = undefined, .blue = undefined, }; pub inline fn RGB(red: u8, green: u8, blue: u8) Color { return .{ .type = .RGB, .red = red, .green = green, .blue = blue, }; }