From 1e7b589e77c7935cbaa8381f50cdcb86c85fa532 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 18 Mar 2026 22:23:53 +0100 Subject: Implement first structure of jpg and farbfeld --- src/color.zig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/color.zig (limited to 'src/color.zig') 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, + }; + } + }; +} -- cgit v1.2.3-70-g09d2