Android generates random unique color code

I want to create a random, unique color code. Is there any algorithm?

+3
source share
1 answer
Random color = new Random();

Color randomColor = new Color(color.nextInt(256),color.nextInt(256),color.nextInt(256));

Ofcouse pedantically speaking, not sure to be random;)

+5
source

Source: https://habr.com/ru/post/1786345/


All Articles