From 38b1babb974dc943d21e358c6ff63c993d747f6b Mon Sep 17 00:00:00 2001 From: julian laplace Date: Tue, 15 Jul 2025 14:49:01 +0200 Subject: edit copy --- client/lib/color.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'client/lib') diff --git a/client/lib/color.js b/client/lib/color.js index bbc137e..294317e 100644 --- a/client/lib/color.js +++ b/client/lib/color.js @@ -54,7 +54,7 @@ function channel(t, a, b, c, d, add, mul) { return a + b * Math.cos(2 * Math.PI * (c * t + d)) * mul + add; } -function color(t, add, mul) { +function color(t, add, mul, alpha) { let a, b, c, d; const rgb = []; for (var i = 0; i < 3; i++) { @@ -64,6 +64,9 @@ function color(t, add, mul) { d = palette[3][i]; rgb[i] = Math.round(channel(-t, a, b, c, d, add, mul) * 255); } + if (alpha) { + return "rgba(" + rgb + "," + alpha + ")"; + } return "rgb(" + rgb + ")"; } -- cgit v1.2.3-70-g09d2