authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-10-14 14:34:13 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-10-14 14:34:13 -07:00
logb561b5cf68d7d7120d5094fdfe7ad8f905759f92
tree63aee582dfc41f10c753e04526c0bf2d5c279384
parent1af3b0a4f587b3ae4c25fad867decc2fbcfdc4af

sRGB: needs the _x import


1 files changed, 3 insertions(+), 0 deletions(-)

sRGB.zig+3
...@@ -3,6 +3,7 @@...@@ -3,6 +3,7 @@
3const std = @import("std");3const std = @import("std");
4const Self = @This();4const Self = @This();
5const color = @import("./mod.zig");5const color = @import("./mod.zig");
6const _x = @import("./_x.zig");
67
7r: u8, // red value8r: u8, // red value
8g: u8, // green value9g: u8, // green value
...@@ -72,6 +73,8 @@ pub fn format(x: Self, comptime fmt: []const u8, options: std.fmt.FormatOptions,...@@ -72,6 +73,8 @@ pub fn format(x: Self, comptime fmt: []const u8, options: std.fmt.FormatOptions,
72 });73 });
73}74}
7475
76pub usingnamespace _x.mixin(@This(), .r, .g, .b);
77
75pub fn to_linear_rgb(x: Self) color.LinearRgb {78pub fn to_linear_rgb(x: Self) color.LinearRgb {
76 const lut = comptime blk: {79 const lut = comptime blk: {
77 @setEvalBranchQuota(10_000);80 @setEvalBranchQuota(10_000);