summaryrefslogtreecommitdiff
path: root/src/animation.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-23 11:12:56 -0300
committerGabriel Schneider <[email protected]>2026-10-23 17:10:58 -0300
commita53a1aafb9804e943bdcd720c2bb688ecb90a888 (patch)
tree197ee0ac4106037d49c5c9fc7a2b6be4186173bf /src/animation.zig
parenta0d367b6c54ff29737662fd7cf5a78d4d183cb20 (diff)
downloadpardes-a53a1aafb9804e943bdcd720c2bb688ecb90a888.tar.gz
pardes-a53a1aafb9804e943bdcd720c2bb688ecb90a888.zip
Audit (colours, drawing): one Surface.tint, shared colour maths, the helix copies of hand-ported themes removed
The 22 <name>_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 <[email protected]>
Diffstat (limited to 'src/animation.zig')
-rw-r--r--src/animation.zig16
1 files changed, 4 insertions, 12 deletions
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;
}
};