authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-09-14 19:39:04 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-09-14 19:39:04 -07:00
logc1d46a4d37839675182d91ad2d2b8e799850a8d6
treec92a742a3c5c963a0a19a62b74847d729438624c
parent7669ab8ca2f61cb89672db43a117916d73d84acd

eql() functions should also compare alpha


2 files changed, 2 insertions(+), 2 deletions(-)

LinearRgb.zig+1-1
...@@ -22,7 +22,7 @@ pub fn initRGBA(r: f32, g: f32, b: f32, a: f32) Self {...@@ -22,7 +22,7 @@ pub fn initRGBA(r: f32, g: f32, b: f32, a: f32) Self {
22}22}
2323
24pub fn eql(x: Self, y: Self) bool {24pub fn eql(x: Self, y: Self) bool {
25 return x.r == y.r and x.g == y.g and x.b == y.b;25 return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a;
26}26}
2727
28pub fn relative_luminance(x: Self) f32 {28pub fn relative_luminance(x: Self) f32 {
sRGB.zig+1-1
...@@ -42,7 +42,7 @@ pub fn parseHex(input: []const u8) Self {...@@ -42,7 +42,7 @@ pub fn parseHex(input: []const u8) Self {
42}42}
4343
44pub fn eql(x: Self, y: Self) bool {44pub fn eql(x: Self, y: Self) bool {
45 return x.r == y.r and x.g == y.g and x.b == y.b;45 return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a;
46}46}
4747
48pub fn format(x: Self, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {48pub fn format(x: Self, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {