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 成員的 ARGB 屬性。The following code example demonstrates the A, R, G, and B properties of a Color, and the Implicit member.

這個範例是設計來與 Windows Form 搭配使用。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、紅色、綠色或藍色元件,請分別使用 [A]、[R]、[G] 或 [B] 屬性。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

取得系統定義的色彩,此色彩具有 #FFF0F8FF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF0F8FF.

AntiqueWhite

取得系統定義的色彩,此色彩具有 #FFFAEBD7 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFAEBD7.

Aqua

取得系統定義的色彩,此色彩具有 #FF00FFFF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF00FFFF.

Aquamarine

取得系統定義的色彩,此色彩具有 #FF7FFFD4 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF7FFFD4.

Azure

取得系統定義的色彩,此色彩具有 #FFF0FFFF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF0FFFF.

B

取得這個 Color 結構的藍色元件值。Gets the blue component value of this Color structure.

Beige

取得系統定義的色彩,此色彩具有 #FFF5F5DC 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF5F5DC.

Bisque

取得系統定義的色彩,此色彩具有 #FFFFE4C4 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFE4C4.

Black

取得系統定義的色彩,此色彩具有 #FF000000 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF000000.

BlanchedAlmond

取得系統定義的色彩,此色彩具有 #FFFFEBCD 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFEBCD.

Blue

取得系統定義的色彩,此色彩具有 #FF0000FF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF0000FF.

BlueViolet

取得系統定義的色彩,此色彩具有 #FF8A2BE2 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF8A2BE2.

Brown

取得系統定義的色彩,此色彩具有 #FFA52A2A 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFA52A2A.

BurlyWood

取得系統定義的色彩,此色彩具有 #FFDEB887 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFDEB887.

CadetBlue

取得系統定義的色彩,此色彩具有 #FF5F9EA0 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF5F9EA0.

Chartreuse

取得系統定義的色彩,此色彩具有 #FF7FFF00 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF7FFF00.

Chocolate

取得系統定義的色彩,此色彩具有 #FFD2691E 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFD2691E.

Coral

取得系統定義的色彩,此色彩具有 #FFFF7F50 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF7F50.

CornflowerBlue

取得系統定義的色彩,此色彩具有 #FF6495ED 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF6495ED.

Cornsilk

取得系統定義的色彩,此色彩具有 #FFFFF8DC 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFF8DC.

Crimson

取得系統定義的色彩,此色彩具有 #FFDC143C 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFDC143C.

Cyan

取得系統定義的色彩,此色彩具有 #FF00FFFF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF00FFFF.

DarkBlue

取得系統定義的色彩,此色彩具有 #FF00008B 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF00008B.

DarkCyan

取得系統定義的色彩,此色彩具有 #FF008B8B 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF008B8B.

DarkGoldenrod

取得系統定義的色彩,此色彩具有 #FFB8860B 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFB8860B.

DarkGray

取得系統定義的色彩,此色彩具有 #FFA9A9A9 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFA9A9A9.

DarkGreen

取得系統定義的色彩,此色彩具有 #FF006400 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF006400.

DarkKhaki

取得系統定義的色彩,此色彩具有 #FFBDB76B 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFBDB76B.

DarkMagenta

取得系統定義的色彩,此色彩具有 #FF8B008B 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF8B008B.

DarkOliveGreen

取得系統定義的色彩,此色彩具有 #FF556B2F 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF556B2F.

DarkOrange

取得系統定義的色彩,此色彩具有 #FFFF8C00 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF8C00.

DarkOrchid

取得系統定義的色彩,此色彩具有 #FF9932CC 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF9932CC.

DarkRed

取得系統定義的色彩,此色彩具有 #FF8B0000 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF8B0000.

DarkSalmon

取得系統定義的色彩,此色彩具有 #FFE9967A 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFE9967A.

DarkSeaGreen

取得具有 #FF8FBC8B 之 ARGB 值的系統定義色彩。Gets a system-defined color that has an ARGB value of #FF8FBC8B.

DarkSlateBlue

取得系統定義的色彩,此色彩具有 #FF483D8B 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF483D8B.

DarkSlateGray

取得系統定義的色彩,此色彩具有 #FF2F4F4F 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF2F4F4F.

DarkTurquoise

取得系統定義的色彩,此色彩具有 #FF00CED1 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF00CED1.

DarkViolet

取得系統定義的色彩,此色彩具有 #FF9400D3 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF9400D3.

DeepPink

取得系統定義的色彩,此色彩具有 #FFFF1493 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF1493.

DeepSkyBlue

取得系統定義的色彩,此色彩具有 #FF00BFFF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF00BFFF.

DimGray

取得系統定義的色彩,此色彩具有 #FF696969 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF696969.

DodgerBlue

取得系統定義的色彩,此色彩具有 #FF1E90FF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF1E90FF.

Firebrick

取得系統定義的色彩,此色彩具有 #FFB22222 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFB22222.

FloralWhite

取得系統定義的色彩,此色彩具有 #FFFFFAF0 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFFAF0.

ForestGreen

取得系統定義的色彩,此色彩具有 #FF228B22 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF228B22.

Fuchsia

取得系統定義的色彩,此色彩具有 #FFFF00FF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF00FF.

G

取得這個 Color 結構的綠色元件值。Gets the green component value of this Color structure.

Gainsboro

取得系統定義的色彩,此色彩具有 #FFDCDCDC 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFDCDCDC.

GhostWhite

取得系統定義的色彩,此色彩具有 #FFF8F8FF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF8F8FF.

Gold

取得系統定義的色彩,此色彩具有 #FFFFD700 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFD700.

Goldenrod

取得系統定義的色彩,此色彩具有 #FFDAA520 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFDAA520.

Gray

取得系統定義的色彩,此色彩具有 #FF808080 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF808080.

Green

取得系統定義的色彩,此色彩具有 #FF008000 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF008000.

GreenYellow

取得系統定義的色彩,此色彩具有 #FFADFF2F 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFADFF2F.

Honeydew

取得系統定義的色彩,此色彩具有 #FFF0FFF0 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF0FFF0.

HotPink

取得系統定義的色彩,此色彩具有 #FFFF69B4 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF69B4.

IndianRed

取得系統定義的色彩,此色彩具有 #FFCD5C5C 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFCD5C5C.

Indigo

取得系統定義的色彩,此色彩具有 #FF4B0082 的 ARGB 值。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

取得系統定義的色彩,此色彩具有 #FFFFFFF0 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFFFF0.

Khaki

取得系統定義的色彩,此色彩具有 #FFF0E68C 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF0E68C.

Lavender

取得系統定義的色彩,此色彩具有 #FFE6E6FA 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFE6E6FA.

LavenderBlush

取得系統定義的色彩,此色彩具有 #FFFFF0F5 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFF0F5.

LawnGreen

取得系統定義的色彩,此色彩具有 #FF7CFC00 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF7CFC00.

LemonChiffon

取得系統定義的色彩,此色彩具有 #FFFFFACD 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFFACD.

LightBlue

取得系統定義的色彩,此色彩具有 #FFADD8E6 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFADD8E6.

LightCoral

取得系統定義的色彩,此色彩具有 #FFF08080 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF08080.

LightCyan

取得系統定義的色彩,此色彩具有 #FFE0FFFF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFE0FFFF.

LightGoldenrodYellow

取得系統定義的色彩,此色彩具有 #FFFAFAD2 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFAFAD2.

LightGray

取得系統定義的色彩,此色彩具有 #FFD3D3D3 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFD3D3D3.

LightGreen

取得系統定義的色彩,此色彩具有 #FF90EE90 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF90EE90.

LightPink

取得系統定義的色彩,此色彩具有 #FFFFB6C1 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFB6C1.

LightSalmon

取得系統定義的色彩,此色彩具有 #FFFFA07A 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFA07A.

LightSeaGreen

取得系統定義的色彩,此色彩具有 #FF20B2AA 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF20B2AA.

LightSkyBlue

取得系統定義的色彩,此色彩具有 #FF87CEFA 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF87CEFA.

LightSlateGray

取得系統定義的色彩,此色彩具有 #FF778899 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF778899.

LightSteelBlue

取得系統定義的色彩,此色彩具有 #FFB0C4DE 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFB0C4DE.

LightYellow

取得系統定義的色彩,此色彩具有 #FFFFFFE0 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFFFE0.

Lime

取得系統定義的色彩,此色彩具有 #FF00FF00 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF00FF00.

LimeGreen

取得系統定義的色彩,此色彩具有 #FF32CD32 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF32CD32.

Linen

取得系統定義的色彩,此色彩具有 #FFFAF0E6 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFAF0E6.

Magenta

取得系統定義的色彩,此色彩具有 #FFFF00FF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF00FF.

Maroon

取得系統定義的色彩,此色彩具有 #FF800000 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF800000.

MediumAquamarine

取得系統定義的色彩,此色彩具有 #FF66CDAA 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF66CDAA.

MediumBlue

取得系統定義的色彩,此色彩具有 #FF0000CD 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF0000CD.

MediumOrchid

取得系統定義的色彩,此色彩具有 #FFBA55D3 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFBA55D3.

MediumPurple

取得系統定義的色彩,此色彩具有 #FF9370DB 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF9370DB.

MediumSeaGreen

取得系統定義的色彩,此色彩具有 #FF3CB371 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF3CB371.

MediumSlateBlue

取得系統定義的色彩,此色彩具有 #FF7B68EE 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF7B68EE.

MediumSpringGreen

取得系統定義的色彩,此色彩具有 #FF00FA9A 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF00FA9A.

MediumTurquoise

取得系統定義的色彩,此色彩具有 #FF48D1CC 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF48D1CC.

MediumVioletRed

取得系統定義的色彩,此色彩具有 #FFC71585 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFC71585.

MidnightBlue

取得系統定義的色彩,此色彩具有 #FF191970 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF191970.

MintCream

取得系統定義的色彩,此色彩具有 #FFF5FFFA 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF5FFFA.

MistyRose

取得系統定義的色彩,此色彩具有 #FFFFE4E1 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFE4E1.

Moccasin

取得系統定義的色彩,此色彩具有 #FFFFE4B5 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFE4B5.

Name

取得這個 Color 的名稱。Gets the name of this Color.

NavajoWhite

取得系統定義的色彩,此色彩具有 #FFFFDEAD 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFDEAD.

Navy

取得系統定義的色彩,此色彩具有 #FF000080 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF000080.

OldLace

取得系統定義的色彩,此色彩具有 #FFFDF5E6 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFDF5E6.

Olive

取得系統定義的色彩,此色彩具有 #FF808000 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF808000.

OliveDrab

取得系統定義的色彩,此色彩具有 #FF6B8E23 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF6B8E23.

Orange

取得系統定義的色彩,此色彩具有 #FFFFA500 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFA500.

OrangeRed

取得系統定義的色彩,此色彩具有 #FFFF4500 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF4500.

Orchid

取得系統定義的色彩,此色彩具有 #FFDA70D6 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFDA70D6.

PaleGoldenrod

取得系統定義的色彩,此色彩具有 #FFEEE8AA 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFEEE8AA.

PaleGreen

取得系統定義的色彩,此色彩具有 #FF98FB98 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF98FB98.

PaleTurquoise

取得系統定義的色彩,此色彩具有 #FFAFEEEE 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFAFEEEE.

PaleVioletRed

取得系統定義的色彩,此色彩具有 #FFDB7093 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFDB7093.

PapayaWhip

取得系統定義的色彩,此色彩具有 #FFFFEFD5 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFEFD5.

PeachPuff

取得系統定義的色彩,此色彩具有 #FFFFDAB9 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFDAB9.

Peru

取得系統定義的色彩,此色彩具有 #FFCD853F 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFCD853F.

Pink

取得系統定義的色彩,此色彩具有 #FFFFC0CB 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFC0CB.

Plum

取得系統定義的色彩,此色彩具有 #FFDDA0DD 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFDDA0DD.

PowderBlue

取得系統定義的色彩,此色彩具有 #FFB0E0E6 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFB0E0E6.

Purple

取得系統定義的色彩,此色彩具有 #FF800080 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF800080.

R

取得這個 Color 結構的紅色元件值。Gets the red component value of this Color structure.

Red

取得系統定義的色彩,此色彩具有 #FFFF0000 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF0000.

RosyBrown

取得系統定義的色彩,此色彩具有 #FFBC8F8F 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFBC8F8F.

RoyalBlue

取得系統定義的色彩,此色彩具有 #FF4169E1 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF4169E1.

SaddleBrown

取得系統定義的色彩,此色彩具有 #FF8B4513 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF8B4513.

Salmon

取得系統定義的色彩,此色彩具有 #FFFA8072 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFA8072.

SandyBrown

取得系統定義的色彩,此色彩具有 #FFF4A460 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF4A460.

SeaGreen

取得系統定義的色彩,此色彩具有 #FF2E8B57 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF2E8B57.

SeaShell

取得系統定義的色彩,此色彩具有 #FFFFF5EE 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFF5EE.

Sienna

取得系統定義的色彩,此色彩具有 #FFA0522D 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFA0522D.

Silver

取得系統定義的色彩,此色彩具有 #FFC0C0C0 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFC0C0C0.

SkyBlue

取得系統定義的色彩,此色彩具有 #FF87CEEB 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF87CEEB.

SlateBlue

取得系統定義的色彩,此色彩具有 #FF6A5ACD 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF6A5ACD.

SlateGray

取得系統定義的色彩,此色彩具有 #FF708090 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF708090.

Snow

取得系統定義的色彩,此色彩具有 #FFFFFAFA 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFFAFA.

SpringGreen

取得系統定義的色彩,此色彩具有 #FF00FF7F 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF00FF7F.

SteelBlue

取得系統定義的色彩,此色彩具有 #FF4682B4 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF4682B4.

Tan

取得系統定義的色彩,此色彩具有 #FFD2B48C 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFD2B48C.

Teal

取得系統定義的色彩,此色彩具有 #FF008080 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF008080.

Thistle

取得系統定義的色彩,此色彩具有 #FFD8BFD8 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFD8BFD8.

Tomato

取得系統定義的色彩,此色彩具有 #FFFF6347 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFF6347.

Transparent

取得系統定義的色彩。Gets a system-defined color.

Turquoise

取得系統定義的色彩,此色彩具有 #FF40E0D0 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FF40E0D0.

Violet

取得系統定義的色彩,此色彩具有 #FFEE82EE 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFEE82EE.

Wheat

取得系統定義的色彩,此色彩具有 #FFF5DEB3 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF5DEB3.

White

取得系統定義的色彩,此色彩具有 #FFFFFFFF 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFFFFF.

WhiteSmoke

取得系統定義的色彩,此色彩具有 #FFF5F5F5 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFF5F5F5.

Yellow

取得系統定義的色彩,此色彩具有 #FFFFFF00 的 ARGB 值。Gets a system-defined color that has an ARGB value of #FFFFFF00.

YellowGreen

取得系統定義的色彩,此色彩具有 #FF9ACD32 的 ARGB 值。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 結構 (但是使用新指定的 Alpha 值) 建立 Color 結構。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()

取得這個 KnownColor 結構的 Color 值。Gets the KnownColor value of this Color structure.

ToString()

將這個 Color 結構轉換為人們可讀取的 (Human-Readable) 字串。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.

適用於

另請參閱