Color color = Color.Blue; string strColor = color.ToString(); Console.WriteLine(strColor);
Color color = Color.FromArgb(255, 0, 255); string strColor = color.ToString(); Console.WriteLine(strColor);In this example, the ToString method is used to convert the custom color object "Alpha 255, Red 0, Green 255, Blue 0" into its string representation. The resulting output will be "Color [A=255, R=0, G=255, B=0]". The package library for System Color ToString is the System.Drawing namespace. This namespace provides access to GDI+ basic graphics functionality, which is used to draw shapes, text, and images on Windows client applications.