Click to See Complete Forum and Search --> : Get Color name from ARGB for customized color


vinnureddy
July 30th, 2009, 07:08 AM
Hi,

how can we get Color name when ARGB value is given for a customized color.I tried in many ways.Able to get the when it is a known color or named color.

My project needs to capture the image from webcam and from the image i need to get the color from the specified pixel and should confirm that expected image came.

when it is named color..it is very simple.

Code :

string Name = "Give here Hex value of the required color";
ColorConverter cc = new ColorConverter();
Color c = (Color)cc.ConvertFromString(Name);
if (c.IsNamedColor)
Name = c.Name;


Help is required in the case of custom color.

Thanks
vinni

zips
July 30th, 2009, 12:25 PM
There are 16,777,216 possible combinations of RGB. .NET cannot possibly have a name for every one of them.

BigEd781
July 30th, 2009, 12:43 PM
You are assuming that every possible color has been given a name, but that is not the case. There are so many shades between what we call named colors that it would be silly to do so (and probably very difficult to think up new names for each one :))