Easiest way is to use String.Format
and use the hexadecimal format for the argument.
var random = new Random();
var color = String.Format("#{0:X6}", random.Next(0x1000000)); // = "#A197B9"
Easiest way is to use String.Format
and use the hexadecimal format for the argument.
var random = new Random();
var color = String.Format("#{0:X6}", random.Next(0x1000000)); // = "#A197B9"