brandonmcconnell icon

Color Averaging (for Chromedi)

brandonmcconnell | PRO | 03/21/22 02:27:40 PM UTC | 0 ⭐ | 245 👁️ | Never ⏰ | []
text |

290 B

|

None

|

0 👍

/

0 👎

const avgEach = (...arrays) => Array(arrays[0].length).fill().map((_, i) => arrays.reduce((a, c) => a + c[i], 0) / arrays.length);
const setRgb = ([r,g,b]) => test.style.backgroundColor = `rgb(${r} ${g} ${g})`;
const setHsl = ([h,s,l]) => test.style.backgroundColor = `hsl(${h}deg ${s}% ${l}%)`;

Comments