string s = string .Format( " #{0:X2}{1:X2}{2:X2} " , Color.Yellow.R, Color.Yellow.G, Color.Yellow.B); // s = "#FFFF00"