Why WPF Brushes.Green value is #FF008000

Martin Zhang 21 Reputation points
2021-02-02T04:31:32.88+00:00

Red is #FFFF0000, no problem. But for Green, it is not #FF0FF000, it is #FF008000, this is very strange. Can some guy give me a explaination?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,854 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,542 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,191 Reputation points
    2021-02-02T06:52:01.263+00:00

    FF00FF00 is Lime color
    See : Colors Class


2 additional answers

Sort by: Most helpful
  1. Peter Fleischer (former MVP) 19,341 Reputation points
    2021-02-02T05:32:57.877+00:00

    Hi,
    see ARGB32.

    Green is #FF00FF00, not #FF0FF000 !

    62747-x.png


  2. DaisyTian-1203 11,641 Reputation points
    2021-02-02T07:03:06.96+00:00

    Green is system-defined color that has the ARGB value of #FF008000, you can see it in Colors.Green Property. You can check it with adding System.Drawing dll to your project and using below code to get the name of it:

     Color color = ColorTranslator.FromHtml("#FF008000");  
     Color color2 = ColorTranslator.FromHtml("#FF00FF00");  
     MessageBox.Show("#FF008000 Color Name is:" + color.Name+ "\n #FF00FF00 Color Name is:" + color2.Name);  
    

    You can see the result picture:
    62756-capture.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.