1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
const std = @import("std"); pub fn Rgba(comptime bits: u16) type { const Uint = std.meta.Int(.unsigned, bits); return packed struct { const Self = @This(); red: Uint, green: Uint, blue: Uint, alpha: Uint, pub fn init(r: Uint, g: Uint, b: Uint, a: Uint) Self { return .{ .red = r, .green = g, .blue = b, .alpha = a, }; } }; }