From a3432d5c6cfff5e8e5d3ece14c86fd67da3a6a69 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 26 Jun 2017 03:45:15 +0200 Subject: more color stuff --- client/lib/color.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client/lib/color.js') diff --git a/client/lib/color.js b/client/lib/color.js index bd5b7ce..41258ab 100644 --- a/client/lib/color.js +++ b/client/lib/color.js @@ -9,13 +9,15 @@ const palettes = [ [[0.8, 0.5, 0.4], [0.2, 0.4, 0.2], [2.0, 1.0, 1.0], [0.00, 0.25, 0.25]], ] -let palette = palettes[0] +let palette = palettes[5] 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) { + add = add || 0 + mul = mul || 1 let a, b, c, d const rgb = [] for (var i = 0; i < 3; i++) { -- cgit v1.2.3-70-g09d2