Color Color Color Color Struct

定義

表示 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)
繼承
屬性
實作

範例

下列程式碼範例示範A的、 RGB屬性Color, 以及Implicit成員。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. 將程式碼貼入表單, 並從ShowPropertiesOfSlateBlue表單的Paint事件處理方法呼叫方法, 並以e PaintEventArgs傳遞。Paste 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使用、 RGB屬性。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 Empty Empty Empty

表示為 null 的色彩。Represents a color that is null.

屬性

A A A A

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

AliceBlue AliceBlue AliceBlue AliceBlue

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

AntiqueWhite AntiqueWhite AntiqueWhite AntiqueWhite

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

Aqua Aqua Aqua Aqua

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

Aquamarine Aquamarine Aquamarine Aquamarine

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

Azure Azure Azure Azure

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

B B B B

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

Beige Beige Beige Beige

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

Bisque Bisque Bisque Bisque

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

Black Black Black Black

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

BlanchedAlmond BlanchedAlmond BlanchedAlmond BlanchedAlmond

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

Blue Blue Blue Blue

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

BlueViolet BlueViolet BlueViolet BlueViolet

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

Brown Brown Brown Brown

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

BurlyWood BurlyWood BurlyWood BurlyWood

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

CadetBlue CadetBlue CadetBlue CadetBlue

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

Chartreuse Chartreuse Chartreuse Chartreuse

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

Chocolate Chocolate Chocolate Chocolate

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

Coral Coral Coral Coral

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

CornflowerBlue CornflowerBlue CornflowerBlue CornflowerBlue

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

Cornsilk Cornsilk Cornsilk Cornsilk

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

Crimson Crimson Crimson Crimson

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

Cyan Cyan Cyan Cyan

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

DarkBlue DarkBlue DarkBlue DarkBlue

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

DarkCyan DarkCyan DarkCyan DarkCyan

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

DarkGoldenrod DarkGoldenrod DarkGoldenrod DarkGoldenrod

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

DarkGray DarkGray DarkGray DarkGray

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

DarkGreen DarkGreen DarkGreen DarkGreen

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

DarkKhaki DarkKhaki DarkKhaki DarkKhaki

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

DarkMagenta DarkMagenta DarkMagenta DarkMagenta

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

DarkOliveGreen DarkOliveGreen DarkOliveGreen DarkOliveGreen

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

DarkOrange DarkOrange DarkOrange DarkOrange

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

DarkOrchid DarkOrchid DarkOrchid DarkOrchid

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

DarkRed DarkRed DarkRed DarkRed

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

DarkSalmon DarkSalmon DarkSalmon DarkSalmon

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

DarkSeaGreen DarkSeaGreen DarkSeaGreen DarkSeaGreen

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

DarkSlateBlue DarkSlateBlue DarkSlateBlue DarkSlateBlue

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

DarkSlateGray DarkSlateGray DarkSlateGray DarkSlateGray

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

DarkTurquoise DarkTurquoise DarkTurquoise DarkTurquoise

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

DarkViolet DarkViolet DarkViolet DarkViolet

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

DeepPink DeepPink DeepPink DeepPink

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

DeepSkyBlue DeepSkyBlue DeepSkyBlue DeepSkyBlue

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

DimGray DimGray DimGray DimGray

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

DodgerBlue DodgerBlue DodgerBlue DodgerBlue

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

Firebrick Firebrick Firebrick Firebrick

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

FloralWhite FloralWhite FloralWhite FloralWhite

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

ForestGreen ForestGreen ForestGreen ForestGreen

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

Fuchsia Fuchsia Fuchsia Fuchsia

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

G G G G

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

Gainsboro Gainsboro Gainsboro Gainsboro

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

GhostWhite GhostWhite GhostWhite GhostWhite

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

Gold Gold Gold Gold

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

Goldenrod Goldenrod Goldenrod Goldenrod

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

Gray Gray Gray Gray

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

Green Green Green Green

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

GreenYellow GreenYellow GreenYellow GreenYellow

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

Honeydew Honeydew Honeydew Honeydew

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

HotPink HotPink HotPink HotPink

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

IndianRed IndianRed IndianRed IndianRed

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

Indigo Indigo Indigo Indigo

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

IsEmpty IsEmpty IsEmpty IsEmpty

指定這個 Color 結構是否未初始化。Specifies whether this Color structure is uninitialized.

IsKnownColor IsKnownColor IsKnownColor 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 IsNamedColor IsNamedColor IsNamedColor

取得值,指出這個 Color 結構是否為命名色彩,或是 KnownColor 列舉型別的成員。Gets a value indicating whether this Color structure is a named color or a member of the KnownColor enumeration.

IsSystemColor IsSystemColor IsSystemColor 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 Ivory Ivory Ivory

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

Khaki Khaki Khaki Khaki

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

Lavender Lavender Lavender Lavender

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

LavenderBlush LavenderBlush LavenderBlush LavenderBlush

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

LawnGreen LawnGreen LawnGreen LawnGreen

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

LemonChiffon LemonChiffon LemonChiffon LemonChiffon

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

LightBlue LightBlue LightBlue LightBlue

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

LightCoral LightCoral LightCoral LightCoral

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

LightCyan LightCyan LightCyan LightCyan

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

LightGoldenrodYellow LightGoldenrodYellow LightGoldenrodYellow LightGoldenrodYellow

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

LightGray LightGray LightGray LightGray

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

LightGreen LightGreen LightGreen LightGreen

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

LightPink LightPink LightPink LightPink

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

LightSalmon LightSalmon LightSalmon LightSalmon

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

LightSeaGreen LightSeaGreen LightSeaGreen LightSeaGreen

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

LightSkyBlue LightSkyBlue LightSkyBlue LightSkyBlue

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

LightSlateGray LightSlateGray LightSlateGray LightSlateGray

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

LightSteelBlue LightSteelBlue LightSteelBlue LightSteelBlue

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

LightYellow LightYellow LightYellow LightYellow

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

Lime Lime Lime Lime

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

LimeGreen LimeGreen LimeGreen LimeGreen

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

Linen Linen Linen Linen

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

Magenta Magenta Magenta Magenta

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

Maroon Maroon Maroon Maroon

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

MediumAquamarine MediumAquamarine MediumAquamarine MediumAquamarine

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

MediumBlue MediumBlue MediumBlue MediumBlue

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

MediumOrchid MediumOrchid MediumOrchid MediumOrchid

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

MediumPurple MediumPurple MediumPurple MediumPurple

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

MediumSeaGreen MediumSeaGreen MediumSeaGreen MediumSeaGreen

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

MediumSlateBlue MediumSlateBlue MediumSlateBlue MediumSlateBlue

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

MediumSpringGreen MediumSpringGreen MediumSpringGreen MediumSpringGreen

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

MediumTurquoise MediumTurquoise MediumTurquoise MediumTurquoise

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

MediumVioletRed MediumVioletRed MediumVioletRed MediumVioletRed

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

MidnightBlue MidnightBlue MidnightBlue MidnightBlue

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

MintCream MintCream MintCream MintCream

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

MistyRose MistyRose MistyRose MistyRose

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

Moccasin Moccasin Moccasin Moccasin

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

Name Name Name Name

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

NavajoWhite NavajoWhite NavajoWhite NavajoWhite

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

Navy Navy Navy Navy

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

OldLace OldLace OldLace OldLace

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

Olive Olive Olive Olive

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

OliveDrab OliveDrab OliveDrab OliveDrab

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

Orange Orange Orange Orange

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

OrangeRed OrangeRed OrangeRed OrangeRed

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

Orchid Orchid Orchid Orchid

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

PaleGoldenrod PaleGoldenrod PaleGoldenrod PaleGoldenrod

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

PaleGreen PaleGreen PaleGreen PaleGreen

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

PaleTurquoise PaleTurquoise PaleTurquoise PaleTurquoise

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

PaleVioletRed PaleVioletRed PaleVioletRed PaleVioletRed

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

PapayaWhip PapayaWhip PapayaWhip PapayaWhip

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

PeachPuff PeachPuff PeachPuff PeachPuff

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

Peru Peru Peru Peru

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

Pink Pink Pink Pink

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

Plum Plum Plum Plum

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

PowderBlue PowderBlue PowderBlue PowderBlue

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

Purple Purple Purple Purple

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

R R R R

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

Red Red Red Red

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

RosyBrown RosyBrown RosyBrown RosyBrown

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

RoyalBlue RoyalBlue RoyalBlue RoyalBlue

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

SaddleBrown SaddleBrown SaddleBrown SaddleBrown

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

Salmon Salmon Salmon Salmon

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

SandyBrown SandyBrown SandyBrown SandyBrown

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

SeaGreen SeaGreen SeaGreen SeaGreen

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

SeaShell SeaShell SeaShell SeaShell

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

Sienna Sienna Sienna Sienna

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

Silver Silver Silver Silver

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

SkyBlue SkyBlue SkyBlue SkyBlue

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

SlateBlue SlateBlue SlateBlue SlateBlue

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

SlateGray SlateGray SlateGray SlateGray

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

Snow Snow Snow Snow

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

SpringGreen SpringGreen SpringGreen SpringGreen

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

SteelBlue SteelBlue SteelBlue SteelBlue

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

Tan Tan Tan Tan

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

Teal Teal Teal Teal

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

Thistle Thistle Thistle Thistle

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

Tomato Tomato Tomato Tomato

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

Transparent Transparent Transparent Transparent

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

Turquoise Turquoise Turquoise Turquoise

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

Violet Violet Violet Violet

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

Wheat Wheat Wheat Wheat

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

White White White White

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

WhiteSmoke WhiteSmoke WhiteSmoke WhiteSmoke

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

Yellow Yellow Yellow Yellow

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

YellowGreen YellowGreen YellowGreen YellowGreen

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

方法

Equals(Color) Equals(Color) Equals(Color) Equals(Color)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

測試指定的物件是否為 Color 結構,並且和這個 Color 結構相等。Tests whether the specified object is a Color structure and is equivalent to this Color structure.

FromArgb(Int32, Int32, Int32, Int32) FromArgb(Int32, Int32, Int32, Int32) FromArgb(Int32, Int32, Int32, Int32) 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.

FromArgb(Int32, Int32, Int32) FromArgb(Int32, Int32, Int32) FromArgb(Int32, Int32, Int32) 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, Color) FromArgb(Int32, Color) FromArgb(Int32, Color) 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) FromArgb(Int32) FromArgb(Int32) FromArgb(Int32)

從 32 位元的 ARGB 值建立 Color 結構。Creates a Color structure from a 32-bit ARGB value.

FromKnownColor(KnownColor) FromKnownColor(KnownColor) FromKnownColor(KnownColor) FromKnownColor(KnownColor)

從指定的預先定義色彩建立 Color 結構。Creates a Color structure from the specified predefined color.

FromName(String) FromName(String) FromName(String) FromName(String)

從指定的預先定義色彩名稱建立 Color 結構。Creates a Color structure from the specified name of a predefined color.

GetBrightness() GetBrightness() GetBrightness() GetBrightness()

取得這個 Color 結構的色相-彩度-亮度 (HSL) 的亮度值。Gets the hue-saturation-lightness (HSL) lightness value for this Color structure.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個 Color 結構的雜湊程式碼。Returns a hash code for this Color structure.

GetHue() GetHue() GetHue() GetHue()

取得這個 Color 結構的色相-彩度-亮度 (HSL) 的色相值,單位為度。Gets the hue-saturation-lightness (HSL) hue value, in degrees, for this Color structure.

GetSaturation() GetSaturation() GetSaturation() GetSaturation()

取得這個 Color 結構的色相-彩度-亮度 (HSL) 的彩度值。Gets the hue-saturation-lightness (HSL) saturation value for this Color structure.

ToArgb() ToArgb() ToArgb() ToArgb()

取得這個 Color 結構的 32 位元 ARGB 值。Gets the 32-bit ARGB value of this Color structure.

ToKnownColor() ToKnownColor() ToKnownColor() ToKnownColor()

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

ToString() ToString() ToString() ToString()

將這個 Color 結構轉換為人們可讀取的 (Human-Readable) 字串。Converts this Color structure to a human-readable string.

運算子

Equality(Color, Color) Equality(Color, Color) Equality(Color, Color) Equality(Color, Color)

測試兩個指定的 Color 結構是否相等。Tests whether two specified Color structures are equivalent.

Inequality(Color, Color) Inequality(Color, Color) Inequality(Color, Color) Inequality(Color, Color)

測試兩個指定的 Color 結構是否不同。Tests whether two specified Color structures are different.

適用於

另請參閱