Color 结构

定义

表示一种 ARGB 颜色(alpha、红色、绿色、蓝色)。Represents an ARGB (alpha, red, green, blue) color.

public value class Color : IEquatable<System::Drawing::Color>
[System.ComponentModel.TypeConverter(typeof(System.Drawing.ColorConverter))]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public struct Color : IEquatable<System.Drawing.Color>
type Color = struct
Public Structure Color
Implements IEquatable(Of Color)
继承
属性
实现

示例

下面的代码示例演示了 ColorImplicit 成员的 AR GB 属性。The following code example demonstrates the A, R, G, and B properties of a Color, and the Implicit member.

此示例旨在与 Windows 窗体一起使用。This example is designed to be used with a Windows Form. 将代码粘贴到窗体中,并从窗体的 Paint 事件处理方法中调用 ShowPropertiesOfSlateBlue 方法,并将 e 作为 PaintEventArgsPaste the code into the form and call the ShowPropertiesOfSlateBlue method from the form's Paint event-handling method, passing e as PaintEventArgs.

void ShowPropertiesOfSlateBlue( PaintEventArgs^ e )
{
   Color slateBlue = Color::FromName( "SlateBlue" );
   Byte g = slateBlue.G;
   Byte b = slateBlue.B;
   Byte r = slateBlue.R;
   Byte a = slateBlue.A;
   array<Object^>^temp0 = {a,r,g,b};
   String^ text = String::Format( "Slate Blue has these ARGB values: Alpha:{0}, "
   "red:{1}, green: {2}, blue {3}", temp0 );
   e->Graphics->DrawString( text, gcnew System::Drawing::Font( this->Font,FontStyle::Italic ), gcnew SolidBrush( slateBlue ), RectangleF(PointF(0.0F,0.0F),this->Size) );
}
private void ShowPropertiesOfSlateBlue(PaintEventArgs e)
{
    Color slateBlue = Color.FromName("SlateBlue");
    byte g = slateBlue.G;
    byte b = slateBlue.B;
    byte r = slateBlue.R;
    byte a = slateBlue.A;
    string text = String.Format("Slate Blue has these ARGB values: Alpha:{0}, " +
        "red:{1}, green: {2}, blue {3}", new object[]{a, r, g, b});
    e.Graphics.DrawString(text, 
        new Font(this.Font, FontStyle.Italic), 
        new SolidBrush(slateBlue), 
        new RectangleF(new PointF(0.0F, 0.0F), this.Size));
}
Private Sub ShowPropertiesOfSlateBlue(ByVal e As PaintEventArgs)
    Dim slateBlue As Color = Color.FromName("SlateBlue")
    Dim g As Byte = slateBlue.G
    Dim b As Byte = slateBlue.B
    Dim r As Byte = slateBlue.R
    Dim a As Byte = slateBlue.A
    Dim text As String = _
    String.Format("Slate Blue has these ARGB values: Alpha:{0}, " _
       & "red:{1}, green: {2}, blue {3}", New Object() {a, r, g, b})
    e.Graphics.DrawString(text, New Font(Me.Font, FontStyle.Italic), _
        New SolidBrush(slateBlue), _
        New RectangleF(New PointF(0.0F, 0.0F), _
        Size.op_Implicit(Me.Size)))
End Sub

注解

命名颜色通过使用 Color 结构的属性来表示。Named colors are represented by using the properties of the Color structure. 有关这些颜色的详细信息,请参阅按名称显示颜色For more information about these colors, see Colors by Name.

每个像素的颜色表示为32位数字:8位,分别用于 alpha、红色、绿色和蓝色(ARGB)。The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). 这四个组件都是0到255之间的一个数字,0表示没有强度,255表示完全强度。Each of the four components is a number from 0 through 255, with 0 representing no intensity and 255 representing full intensity. Alpha 分量指定颜色的透明度:0完全透明,255完全不透明。The alpha component specifies the transparency of the color: 0 is fully transparent, and 255 is fully opaque. 若要确定颜色的 alpha、红色、绿色或蓝色分量,请分别使用 ARGB 属性。To determine the alpha, red, green, or blue component of a color, use the A, R, G, or B property, respectively. 您可以使用 FromArgb 方法之一创建自定义颜色。You can create a custom color by using one of the FromArgb methods.

字段

Empty

表示值为 null 的颜色。Represents a color that is null.

属性

A

获取此 Color 结构的 alpha 组件值。Gets the alpha component value of this Color structure.

AliceBlue

获取 ARGB 值为 #FFF0F8FF 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFF0F8FF.

AntiqueWhite

获取 ARGB 值为 #FFFAEBD7 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFFAEBD7.

Aqua

获取 ARGB 值为 #FF00FFFF 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF00FFFF.

Aquamarine

获取 ARGB 值为 #FF7FFFD4 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF7FFFD4.

Azure

获取 ARGB 值为 #FFF0FFFF 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFF0FFFF.

B

获取此 Color 结构的蓝色组件值。Gets the blue component value of this Color structure.

Beige

获取 ARGB 值为 #FFF5F5DC 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFF5F5DC.

Bisque

获取 ARGB 值为 #FFFFE4C4 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFFFE4C4.

Black

获取 ARGB 值为 #FF000000 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF000000.

BlanchedAlmond

获取 ARGB 值为 #FFFFEBCD 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFFFEBCD.

Blue

获取 ARGB 值为 #FF0000FF 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF0000FF.

BlueViolet

获取 ARGB 值为 #FF8A2BE2 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF8A2BE2.

Brown

获取 ARGB 值为 #FFA52A2A 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFA52A2A.

BurlyWood

获取 ARGB 值为 #FFDEB887 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFDEB887.

CadetBlue

获取 ARGB 值为 #FF5F9EA0 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF5F9EA0.

Chartreuse

获取 ARGB 值为 #FF7FFF00 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF7FFF00.

Chocolate

获取 ARGB 值为 #FFD2691E 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFD2691E.

Coral

获取 ARGB 值为 #FFFF7F50 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFFF7F50.

CornflowerBlue

获取 ARGB 值为 #FF6495ED 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF6495ED.

Cornsilk

获取 ARGB 值为 #FFFFF8DC 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFFFF8DC.

Crimson

获取 ARGB 值为 #FFDC143C 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFDC143C.

Cyan

获取 ARGB 值为 #FF00FFFF 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF00FFFF.

DarkBlue

获取 ARGB 值为 #FF00008B 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF00008B.

DarkCyan

获取 ARGB 值为 #FF008B8B 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF008B8B.

DarkGoldenrod

获取 ARGB 值为 #FFB8860B 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFB8860B.

DarkGray

获取 ARGB 值为 #FFA9A9A9 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFA9A9A9.

DarkGreen

获取 ARGB 值为 #FF006400 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF006400.

DarkKhaki

获取 ARGB 值为 #FFBDB76B 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFBDB76B.

DarkMagenta

获取 ARGB 值为 #FF8B008B 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF8B008B.

DarkOliveGreen

获取 ARGB 值为 #FF556B2F 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF556B2F.

DarkOrange

获取 ARGB 值为 #FFFF8C00 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFFF8C00.

DarkOrchid

获取 ARGB 值为 #FF9932CC 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF9932CC.

DarkRed

获取 ARGB 值为 #FF8B0000 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF8B0000.

DarkSalmon

获取 ARGB 值为 #FFE9967A 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFE9967A.

DarkSeaGreen

获取 ARGB 值为 #FF8FBC8B 的系统定义的颜色。Gets a system-defined color that has an ARGB value of #FF8FBC8B.

DarkSlateBlue

获取 ARGB 值为 #FF483D8B 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF483D8B.

DarkSlateGray

获取 ARGB 值为 #FF2F4F4F 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF2F4F4F.

DarkTurquoise

获取 ARGB 值为 #FF00CED1 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF00CED1.

DarkViolet

获取 ARGB 值为 #FF9400D3 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF9400D3.

DeepPink

获取 ARGB 值为 #FFFF1493 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFFF1493.

DeepSkyBlue

获取 ARGB 值为 #FF00BFFF 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF00BFFF.

DimGray

获取 ARGB 值为 #FF696969 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF696969.

DodgerBlue

获取 ARGB 值为 #FF1E90FF 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF1E90FF.

Firebrick

获取 ARGB 值为 #FFB22222 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFB22222.

FloralWhite

获取 ARGB 值为 #FFFFFAF0 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FFFFFAF0.

ForestGreen

获取 ARGB 值为 #FF228B22 的系统定义的颜色Gets a system-defined color that has an ARGB value of #FF228B22.

Fuchsia

获取 ARGB 值为 #FFFF00FF 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFF00FF.

G

获取此 Color 结构的绿色组件值。Gets the green component value of this Color structure.

Gainsboro

获取 ARGB 值为 #FFDCDCDC 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFDCDCDC.

GhostWhite

获取 ARGB 值为 #FFF8F8FF 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFF8F8FF.

Gold

获取 ARGB 值为 #FFFFD700 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFD700.

Goldenrod

获取 ARGB 值为 #FFDAA520 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFDAA520.

Gray

获取 ARGB 值为 #FF808080 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF808080.

Green

获取 ARGB 值为 #FF008000 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF008000.

GreenYellow

获取 ARGB 值为 #FFADFF2F 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFADFF2F.

Honeydew

获取 ARGB 值为 #FFF0FFF0 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFF0FFF0.

HotPink

获取 ARGB 值为 #FFFF69B4 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFF69B4.

IndianRed

获取 ARGB 值为 #FFCD5C5C 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFCD5C5C.

Indigo

获取 ARGB 值为 #FF4B0082 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF4B0082.

IsEmpty

指定是否取消初始化此 Color 结构。Specifies whether this Color structure is uninitialized.

IsKnownColor

获取指示此 Color 结构是否为预定义颜色的值。Gets a value indicating whether this Color structure is a predefined color. 预定义颜色由 KnownColor 枚举的元素表示。Predefined colors are represented by the elements of the KnownColor enumeration.

IsNamedColor

获取指示此 Color 结构是命名颜色还是 KnownColor 枚举成员的值。Gets a value indicating whether this Color structure is a named color or a member of the KnownColor enumeration.

IsSystemColor

获取指示此 Color 结构是否为系统颜色的值。Gets a value indicating whether this Color structure is a system color. 系统颜色是指 Windows 显示元素中使用的颜色。A system color is a color that is used in a Windows display element. 系统颜色由 KnownColor 枚举的元素来表示。System colors are represented by elements of the KnownColor enumeration.

Ivory

获取 ARGB 值为 #FFFFFFF0 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFFFF0.

Khaki

获取 ARGB 值为 #FFF0E68C 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFF0E68C.

Lavender

获取 ARGB 值为 #FFE6E6FA 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFE6E6FA.

LavenderBlush

获取 ARGB 值为 #FFFFF0F5 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFF0F5.

LawnGreen

获取 ARGB 值为 #FF7CFC00 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF7CFC00.

LemonChiffon

获取 ARGB 值为 #FFFFFACD 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFFACD.

LightBlue

获取 ARGB 值为 #FFADD8E6 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFADD8E6.

LightCoral

获取 ARGB 值为 #FFF08080 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFF08080.

LightCyan

获取 ARGB 值为 #FFE0FFFF 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFE0FFFF.

LightGoldenrodYellow

获取 ARGB 值为 #FFFAFAD2 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFAFAD2.

LightGray

获取 ARGB 值为 #FFD3D3D3 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFD3D3D3.

LightGreen

获取 ARGB 值为 #FF90EE90 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF90EE90.

LightPink

获取 ARGB 值为 #FFFFB6C1 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFB6C1.

LightSalmon

获取 ARGB 值为 #FFFFA07A 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFA07A.

LightSeaGreen

获取 ARGB 值为 #FF20B2AA 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF20B2AA.

LightSkyBlue

获取 ARGB 值为 #FF87CEFA 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF87CEFA.

LightSlateGray

获取 ARGB 值为 #FF778899 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF778899.

LightSteelBlue

获取 ARGB 值为 #FFB0C4DE 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFB0C4DE.

LightYellow

获取 ARGB 值为 #FFFFFFE0 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFFFE0.

Lime

获取 ARGB 值为 #FF00FF00 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF00FF00.

LimeGreen

获取 ARGB 值为 #FF32CD32 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF32CD32.

Linen

获取 ARGB 值为 #FFFAF0E6 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFAF0E6.

Magenta

获取 ARGB 值为 #FFFF00FF 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFF00FF.

Maroon

获取 ARGB 值为 #FF800000 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF800000.

MediumAquamarine

获取 ARGB 值为 #FF66CDAA 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF66CDAA.

MediumBlue

获取 ARGB 值为 #FF0000CD 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF0000CD.

MediumOrchid

获取 ARGB 值为 #FFBA55D3 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFBA55D3.

MediumPurple

获取 ARGB 值为 #FF9370DB 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF9370DB.

MediumSeaGreen

获取 ARGB 值为 #FF3CB371 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF3CB371.

MediumSlateBlue

获取 ARGB 值为 #FF7B68EE 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF7B68EE.

MediumSpringGreen

获取 ARGB 值为 #FF00FA9A 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF00FA9A.

MediumTurquoise

获取 ARGB 值为 #FF48D1CC 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF48D1CC.

MediumVioletRed

获取 ARGB 值为 #FFC71585 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFC71585.

MidnightBlue

获取 ARGB 值为 #FF191970 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF191970.

MintCream

获取 ARGB 值为 #FFF5FFFA 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFF5FFFA.

MistyRose

获取 ARGB 值为 #FFFFE4E1 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFE4E1.

Moccasin

获取 ARGB 值为 #FFFFE4B5 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFE4B5.

Name

获取此 Color 的名称。Gets the name of this Color.

NavajoWhite

获取 ARGB 值为 #FFFFDEAD 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFDEAD.

Navy

获取 ARGB 值为 #FF000080 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF000080.

OldLace

获取 ARGB 值为 #FFFDF5E6 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFDF5E6.

Olive

获取 ARGB 值为 #FF808000 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF808000.

OliveDrab

获取 ARGB 值为 #FF6B8E23 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF6B8E23.

Orange

获取 ARGB 值为 #FFFFA500 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFA500.

OrangeRed

获取 ARGB 值为 #FFFF4500 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFF4500.

Orchid

获取 ARGB 值为 #FFDA70D6 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFDA70D6.

PaleGoldenrod

获取 ARGB 值为 #FFEEE8AA 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFEEE8AA.

PaleGreen

获取 ARGB 值为 #FF98FB98 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF98FB98.

PaleTurquoise

获取 ARGB 值为 #FFAFEEEE 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFAFEEEE.

PaleVioletRed

获取 ARGB 值为 #FFDB7093 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFDB7093.

PapayaWhip

获取 ARGB 值为 #FFFFEFD5 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFEFD5.

PeachPuff

获取 ARGB 值为 #FFFFDAB9 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFDAB9.

Peru

获取 ARGB 值为 #FFCD853F 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFCD853F.

Pink

获取 ARGB 值为 #FFFFC0CB 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFC0CB.

Plum

获取 ARGB 值为 #FFDDA0DD 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFDDA0DD.

PowderBlue

获取 ARGB 值为 #FFB0E0E6 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFB0E0E6.

Purple

获取 ARGB 值为 #FF800080 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF800080.

R

获取此 Color 结构的红色组件值。Gets the red component value of this Color structure.

Red

获取 ARGB 值为 #FFFF0000 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFF0000.

RosyBrown

获取 ARGB 值为 #FFBC8F8F 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFBC8F8F.

RoyalBlue

获取 ARGB 值为 #FF4169E1 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF4169E1.

SaddleBrown

获取 ARGB 值为 #FF8B4513 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF8B4513.

Salmon

获取 ARGB 值为 #FFFA8072 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFA8072.

SandyBrown

获取 ARGB 值为 #FFF4A460 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFF4A460.

SeaGreen

获取 ARGB 值为 #FF2E8B57 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF2E8B57.

SeaShell

获取 ARGB 值为 #FFFFF5EE 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFF5EE.

Sienna

获取 ARGB 值为 #FFA0522D 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFA0522D.

Silver

获取 ARGB 值为 #FFC0C0C0 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFC0C0C0.

SkyBlue

获取 ARGB 值为 #FF87CEEB 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF87CEEB.

SlateBlue

获取 ARGB 值为 #FF6A5ACD 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF6A5ACD.

SlateGray

获取 ARGB 值为 #FF708090 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF708090.

Snow

获取 ARGB 值为 #FFFFFAFA 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFFAFA.

SpringGreen

获取 ARGB 值为 #FF00FF7F 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF00FF7F.

SteelBlue

获取 ARGB 值为 #FF4682B4 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF4682B4.

Tan

获取 ARGB 值为 #FFD2B48C 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFD2B48C.

Teal

获取 ARGB 值为 #FF008080 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF008080.

Thistle

获取 ARGB 值为 #FFD8BFD8 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFD8BFD8.

Tomato

获取 ARGB 值为 #FFFF6347 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFF6347.

Transparent

获取系统定义的颜色。Gets a system-defined color.

Turquoise

获取 ARGB 值为 #FF40E0D0 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF40E0D0.

Violet

获取 ARGB 值为 #FFEE82EE 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFEE82EE.

Wheat

获取 ARGB 值为 #FFF5DEB3 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFF5DEB3.

White

获取 ARGB 值为 #FFFFFFFF 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFFFFF.

WhiteSmoke

获取 ARGB 值为 #FFF5F5F5 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFF5F5F5.

Yellow

获取 ARGB 值为 #FFFFFF00 的系统定义颜色Gets a system-defined color that has an ARGB value of #FFFFFF00.

YellowGreen

获取 ARGB 值为 #FF9ACD32 的系统定义颜色Gets a system-defined color that has an ARGB value of #FF9ACD32.

方法

Equals(Color)
Equals(Object)

测试指定的对象是否为 Color 结构并等效于此 Color 结构。Tests whether the specified object is a Color structure and is equivalent to this Color structure.

FromArgb(Int32)

基于一个 32 位 ARGB 值创建 Color 结构。Creates a Color structure from a 32-bit ARGB value.

FromArgb(Int32, Color)

从指定的 Color 结构创建 Color 结构,但要使用新指定的 alpha 值。Creates a Color structure from the specified Color structure, but with the new specified alpha value. 尽管此方法允许为 alpha 值传递 32 位值,但该值仅限于 8 位。Although this method allows a 32-bit value to be passed for the alpha value, the value is limited to 8 bits.

FromArgb(Int32, Int32, Int32)

基于指定的 8 位颜色值(红色、绿色和蓝色)创建 Color 结构。Creates a Color structure from the specified 8-bit color values (red, green, and blue). 隐式的 alpha 值为 255(完全不透明)。The alpha value is implicitly 255 (fully opaque). 尽管此方法允许为每个颜色组件传递 32 位值,但每个组件的值仅限于 8 位。Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits.

FromArgb(Int32, Int32, Int32, Int32)

基于四个 ARGB 组件(alpha、红色、绿色和蓝色)值创建 Color 结构。Creates a Color structure from the four ARGB component (alpha, red, green, and blue) values. 尽管此方法允许为每个组件传递 32 位值,但每个组件的值仅限于 8 位。Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits.

FromKnownColor(KnownColor)

基于指定的预定义颜色创建 Color 结构。Creates a Color structure from the specified predefined color.

FromName(String)

基于预定义颜色的指定名称创建 Color 结构。Creates a Color structure from the specified name of a predefined color.

GetBrightness()

获取此 Color 结构的“色调-饱和度-亮度”(HSL) 的亮度值。Gets the hue-saturation-lightness (HSL) lightness value for this Color structure.

GetHashCode()

返回此 Color 结构的哈希代码。Returns a hash code for this Color structure.

GetHue()

获取此 Color 结构的“色调-饱和度-亮度”(HSL) 的色调值,以度为单位。Gets the hue-saturation-lightness (HSL) hue value, in degrees, for this Color structure.

GetSaturation()

获取此 Color 结构的“色调-饱和度-亮度”(HSL) 的饱和度值。Gets the hue-saturation-lightness (HSL) saturation value for this Color structure.

ToArgb()

获取此 Color 结构的 32 位 ARGB 值。Gets the 32-bit ARGB value of this Color structure.

ToKnownColor()

获取此 Color 结构的 KnownColor 值。Gets the KnownColor value of this Color structure.

ToString()

将此 Color 结构转换为用户可读的字符串。Converts this Color structure to a human-readable string.

操作员

Equality(Color, Color)

测试两个指定的 Color 结构是否等效。Tests whether two specified Color structures are equivalent.

Inequality(Color, Color)

测试两个指定的 Color 结构是否不同。Tests whether two specified Color structures are different.

适用于

另请参阅