C # Color objects on the use and the color lookup table

 

 

C # Color objects on the use and the color lookup table

 (2013-03-21 21:07:28)

Reproduced

  Category:  C #

NET framework based on four kinds of color components, transparency, red, green, and blue. Each ingredient is a byte value between 0--255.
Color represents the color configuration, when the class and method to be applied to the one example of the structure of the color .Color when they act on color structure disclosed by the position of the attribute names 140 colors, the property returns a color object created in advance.
color newColor = Color.Red;

Another example is the way to create call static Color FromArgb method, which has four reload mode.
1. Create Color instance parameter component ingredients for four colors
Color c = Color.FromArgb (100,200,200,200); // 1 parameter is the transparency (alpha) parameters, followed by red, green and blue.
2. accept only red, green and blue primary colors, the transparency is set to a default, i.e., fully opaque.
Color C = Color.FromArgb (200,200,200);

3. Create a current Color object from a new instance of Color, transparency only modified components
Color c = Color.FromArgb (100, Color.PowderBlue);
4. integer with a composition in the form of a Color instance created AARRGGBB
Color c = Color.FromArgb (0x64C8C8FF);

You can also create by calling the static method FromKnownColor Color object that accepts KnownColor enumeration value as a parameter..
Color c = Color.FromKnownColor (KnownColor.PowderBlue);

Yet another way is to call the static FromName method, which takes a string parameter, this string must contain the name of a KnownColor enumeration values.
Color c = Color.FromName ( "PowderBlue");

Color Structure There are four color components read-only attribute, A, R, G, B can use these attributes to extract various ingredients, and formulated new color.
Other non-static properties comprising:
IsNamedColor Boolean value, if the color value when naming these 140 colors, the value is true, otherwise to false.
Boolean value IsKnownColor, if the color value is one color KnownColors enumeration, the value to true
IsSystemColor Boolean value, if the color value of the class is the attribute value of SystemColors moment, is true.

The system color
SystemColors type of packaging system 26 kinds of colors, the color of this class may be used by static properties.
Color C = SystemColors.WindowText;

140 KnownColor enumeration contains 26 kinds of color values ​​the color values ​​SystemColors class, and static properties Color structure disclosed.

 

Color lookup table

http://blog.sina.com.cn/s/blog_3e1177090101bzs3.html

Guess you like

Origin blog.csdn.net/cxu123321/article/details/92564062