generate a random number between 1 and 16 million, convert it to hex and use it as a color code
u don't need that, use this: https://codepen.io/chriscoyier/pen/Xojwzw
There’s a reason why it was multiplied by 16777215 ?
Because there are that many colors
two hundred and fifty-six to the power of three = 16777216
https://www.mathsisfun.com/hexadecimal-decimal-colors.html
Обсуждают сегодня