diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-03-18 22:23:53 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-03-18 22:24:10 +0100 |
| commit | 1e7b589e77c7935cbaa8381f50cdcb86c85fa532 (patch) | |
| tree | 6a087761a4b09cd01caff8ae51fb1971d9b0ba8a /src/color.zig | |
Implement first structure of jpg and farbfeld
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, + }; + } + }; +} |