Select a Random Color

From CodeCodex

This code will select a random color and assign it to a variable.

PHP[edit]

$colour = dechex(rand(0,0xffffff)); // 24 bits

Java[edit]

Random r = new Random();
Color  c = new Color(r.nextInt(256), r.nextInt(256), r.nextInt(256));