# VBForums CodeBank > CodeBank - C# >  Random Console Colors!

## abhijit

The ConsoleColor enum has 16 values.


C# Code:
var random = new Random();
for(var i; i < 100; i++)
{
     Console.ForegroundColor = (ConsoleColor)random.Next((int)ConsoleColor.Black, (int)ConsoleColor.Yellow);
     Console.BackgroundColor = (ConsoleColor)random.Next((int)ConsoleColor.Black, (int)ConsoleColor.Yellow);
     Console.WriteLine(i);
}

----------


## BenJones

Cool did not know about the color stuff thanks for shareing.

----------

