saikamesh saikamesh - 1 month ago 5
C# Question

How to convert RGB int values to string color

Can anyone tell me how to convert three int vales

r, g, b
into a string color(hexa value) in C#

Answer
int red = 255;
int green = 255;
int blue = 255;

string theHexColor = "#" + red.ToString("X2") + green.ToString("X2") + blue.ToString("X2");