diff options
Diffstat (limited to 'src/color.zig')
| -rw-r--r-- | src/color.zig | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/color.zig b/src/color.zig new file mode 100644 index 0000000..e27ccb2 --- /dev/null +++ b/src/color.zig @@ -0,0 +1,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, + }; + } + }; +} |