CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    64

    Question Get Color name from ARGB for customized color

    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

  2. #2
    Join Date
    Oct 2004
    Location
    Rocket City
    Posts
    220

    Re: Get Color name from ARGB for customized color

    There are 16,777,216 possible combinations of RGB. .NET cannot possibly have a name for every one of them.

  3. #3
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Get Color name from ARGB for customized color

    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 )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured