diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-06-26 03:45:15 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-06-26 03:45:15 +0200 |
| commit | a3432d5c6cfff5e8e5d3ece14c86fd67da3a6a69 (patch) | |
| tree | d3efda9940649b2518673afaa136ac2a1f34912d /client/lib/color.js | |
| parent | d96b2956888e7b6cf9b036e6ae452e7fc5b4623b (diff) | |
more color stuff
Diffstat (limited to 'client/lib/color.js')
| -rw-r--r-- | client/lib/color.js | 4 |
1 files changed, 3 insertions, 1 deletions
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++) { |
