From e3fda7adba799826aa2016815c228dc4bfdb81cd Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 26 May 2025 07:14:37 +0200 Subject: [PATCH] Add linear interpolation functions for color and value --- animeCat.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/animeCat.js b/animeCat.js index 10f0520..3732b8f 100644 --- a/animeCat.js +++ b/animeCat.js @@ -150,6 +150,14 @@ window.AnimeCat = class AnimeCat { // Zeigt Progress der täglichen Commits an + _lerp(a, b, t) { return a + (b - a) * t; } + _lerpColor(a, b, t) { + return [ + Math.round(this._lerp(a[0], b[0], t)), + Math.round(this._lerp(a[1], b[1], t)), + Math.round(this._lerp(a[2], b[2], t)), + ]; + } animateCatGlow(commitCount) { const glow = this.glow; if (!glow) return;