Is it possible to convert Hexadecimal color code to string color value . For instance if i give a hex color value as "#FFFFFF" it should return value as "White"
string hextostring(string color)
{
//some code//
return string ;
}
Is it possible to convert Hexadecimal color code to string color value . For instance if i give a hex color value as "#FFFFFF" it should return value as "White"
string hextostring(string color)
{
//some code//
return string ;
}
Depending on which version of .NET you're using, you should be able to achieve this by combining call of
ColorTranslator.FromHtml
http://msdn.microsoft.com/en-us/library/system.drawing.colortranslator.fromhtml.aspx
and
ColorTranslator.ToKnownColor
http://msdn.microsoft.com/en-us/library/system.drawing.color.toknowncolor.aspx
Try this:
System.Drawing.Color col = System.Drawing.ColorTranslator.FromHtml("#FFFFFF");