From a53a1aafb9804e943bdcd720c2bb688ecb90a888 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 23 Oct 2026 11:12:56 -0300 Subject: Audit (colours, drawing): one Surface.tint, shared colour maths, the helix copies of hand-ported themes removed The 22 _helix themes that duplicate a hand-written port are gone; monokai, ayu_dark and nord stay, since others inherit from them. Co-Authored-By: Claude Opus 5.5 --- src/animation.zig | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/animation.zig') diff --git a/src/animation.zig b/src/animation.zig index 547b9201..a4887148 100644 --- a/src/animation.zig +++ b/src/animation.zig @@ -1226,22 +1226,14 @@ pub fn Immediate(comptime Value: type) type { }; } -pub fn interpolateRgb(from: [3]u8, to: [3]u8, step: u16, steps: u16) [3]u8 { - if (step == 0) return from; - if (step >= steps) return to; - var out: [3]u8 = undefined; - for (&out, from, to) |*dst, a, b| { - const numerator = @as(u32, a) * (steps - step) + @as(u32, b) * step; - dst.* = @intCast((numerator + steps / 2) / steps); - } - return out; -} - +/// A Fade's value for its tests: a colour stepped channel by channel. const TestColor = struct { rgb: [3]u8, pub fn interpolate(from: TestColor, to: TestColor, step: u16, steps: u16) TestColor { - return .{ .rgb = interpolateRgb(from.rgb, to.rgb, step, steps) }; + var out = from; + for (&out.rgb, to.rgb) |*c, b| c.* = @intCast((@as(u32, c.*) * (steps - step) + @as(u32, b) * step + steps / 2) / steps); + return out; } }; -- cgit v1.3