Color. From Rgb(Byte, Byte, Byte) Метод
Определение
Создает новую структуру Color с использованием заданных значений цветовых каналов sRGB . Creates a new Color structure by using the specified sRGB color channel values.
Параметры
Красный канал sRGB — R — нового цвета. The sRGB red channel, R, of the new color.
Зеленый канал sRGB — G — нового цвета. The sRGB green channel, G, of the new color.
Синий канал sRGB — B — нового цвета. The sRGB blue channel, B, of the new color.
Возвращаемое значение
Структура Color с заданными значениями и значением альфа-канала, равным 255. A Color structure with the specified values and an alpha channel value of 255.
Примеры
В следующем примере показано, как использовать FromRgb метод для создания Color структуры. The following example shows how to use the FromRgb method to create a Color structure.
Комментарии
FromArgbМетод позволяет указать альфа-канал; FromRgb метод использует значение по умолчанию 1 для альфа-канала. The FromArgb method allows you to specify the alpha channel; the FromRgb method uses a default value of 1 for the alpha channel.
Альфа-канал цвета определяет степень прозрачности цвета. The alpha channel of a color determines the amount of transparency of the color. Альфа-значение 1 указывает, что цвет является полностью непрозрачным, а значение 0 означает, что цвет полностью прозрачен. An alpha value of 1 indicates that the color is completely opaque, and a value of 0 indicates that the color is completely transparent.
Каналы sRGB ( A ,, R G , B ) и каналы ScRGB ( ScA , ScR , ScG , ScB ) Color структуры являются синхронизированными свойствами. The sRGB channels (A, R, G, B) and the ScRGB channels (ScA, ScR, ScG, ScB) of the Color structure are synchronized properties. Например, при R изменении канала Red цвета sRGB красный канал цветового ScRGB преобразуется ScR в эквивалентное значение. For example, when R, the sRGB red channel, is modified the ScRGB red channel, ScR, is transformed to the equivalent value.
Color Struct
Definition
Describes a color in terms of alpha, red, green, and blue channels.
Examples
This example shows how to use sRGB, ScRGB, and color profile values to create the color blue.
Remarks
XAML Attribute Usage
XAML Values
predefinedColor
One of the colors predefined by the Colors class.
rgb
A three-digit hexadecimal number. The first digit specifies the color’s R value, the second digit specifies the G value, and the third digit specifies the B value. For example, 00F .
argb
A four-digit hexadecimal number. The first digit specifies the color’s A value, the second digit specifies its R value, the next digit specifies the G value, and the final digit specifies its B value. For example, F00F .
rrggbb
A six-digit hexadecimal number. The first two digits specify the color’s R value, the next two specify its G value, and the final two specify its B value. For example, 0000FF .
aarrggbb
An eight-digit hexadecimal number. The first two digits specify the color’s A value, the next two specify its R value, the next two specify its G value, and the final two specify its B value. For example, FF0000FF .
The International Color Consortium (ICC) or Image Color Management (ICM) color profile.
The alpha channel color value. The value range is 0.0 to 1.0.
A comma-delimited list of three to eight values that represent the color channels of the color profile. The value range is 0.0 to 1.0.
Properties
Gets or sets the sRGB alpha channel value of the color.
Gets or sets the sRGB blue channel value of the color.
Gets the International Color Consortium (ICC) or Image Color Management (ICM) color profile of the color.
Gets or sets the sRGB green channel value of the color.
Gets or sets the sRGB red channel value of the color.
Gets or sets the ScRGB alpha channel value of the color.
Gets or sets the ScRGB blue channel value of the color.
Gets or sets the ScRGB green channel value of the color.
Gets or sets the ScRGB red channel value of the color.
Methods
Adds two Color structures.
Compares two Color structures for fuzzy equality.
Sets the ScRGB channels of the color to within the gamut of 0 to 1, if they are outside that range.
Tests whether the specified Color structure is identical to this color.
Tests whether two Color structures are identical.
Tests whether the specified object is a Color structure and is equivalent to this color.
Creates a new Color structure by using the specified sRGB alpha channel and color channel values.
Creates a new Color structure by using the specified alpha channel, color channel values, and color profile.
Creates a new Color structure by using the specified sRGB color channel values.
Creates a new Color structure by using the specified ScRGB alpha channel and color channel values.
Creates a new Color structure by using the specified color channel values and color profile.
Gets a hash code for this Color structure.
Gets the color channel values of the color.
Multiplies the alpha, red, blue, and green channels of the specified Color structure by the specified value.
Subtracts a Color structure from a Color structure.
Creates a string representation of the color using the sRGB channels.
Creates a string representation of the color by using the sRGB channels and the specified format provider.
Operators
Adds two Color structures.
Tests whether two Color structures are identical.
Tests whether two Color structures are not identical.
Multiplies the alpha, red, blue, and green channels of the specified Color structure by the specified value.
Subtracts a Color structure from a Color structure.
Explicit Interface Implementations
Formats the value of the current instance using the specified format.
Colors Class
Definition
Implements a set of predefined colors.
Remarks
The Windows Presentation Foundation color names match the .NET Framework, Windows Forms, and Microsoft Internet Explorer color names. This representation is based on UNIX X11 named color values.
The following image shows each predefined color, its name, and its hexadecimal value.

Color Table including a color swatch, the color name, and the hexadecimal value
See the Brush class for a variety of other more complex ways you can color an area, including gradients (LinearGradientBrush, RadialGradientBrush) or images (ImageBrush).
XAML Text Usage
You cannot declare this managed class in XAML, but you can use its static properties to assign values in XAML.
Properties
Gets the system-defined color that has an ARGB value of #FFF0F8FF .
Gets the system-defined color that has an ARGB value of #FFFAEBD7 .
Gets the system-defined color that has an ARGB value of #FF00FFFF .
Gets the system-defined color that has an ARGB value of #FF7FFFD4 .
Gets the system-defined color that has an ARGB value of #FFF0FFFF .
Gets the system-defined color that has an ARGB value of #FFF5F5DC .
Gets the system-defined color that has an ARGB value of #FFFFE4C4 .
Gets the system-defined color that has an ARGB value of #FF000000 .
Gets the system-defined color that has an ARGB value of #FFFFEBCD .
Gets the system-defined color that has an ARGB value of #FF0000FF .
Gets the system-defined color that has an ARGB value of #FF8A2BE2 .
Gets the system-defined color that has an ARGB value of #FFA52A2A .
Gets the system-defined color that has an ARGB value of #FFDEB887 .
Gets the system-defined color that has an ARGB value of #FF5F9EA0 .
Gets the system-defined color that has an ARGB value of #FF7FFF00 .
Gets the system-defined color that has an ARGB value of #FFD2691E .
Gets the system-defined color that has an ARGB value of #FFFF7F50 .
Gets the system-defined color that has an ARGB value of #FF6495ED .
Gets the system-defined color that has an ARGB value of #FFFFF8DC .
Gets the system-defined color that has an ARGB value of #FFDC143C .
Gets the system-defined color that has an ARGB value of #FF00FFFF .
Gets the system-defined color that has an ARGB value of #FF00008B .
Gets the system-defined color that has an ARGB value of #FF008B8B .
Gets the system-defined color that has an ARGB value of #FFB8860B .
Gets the system-defined color that has an ARGB value of #FFA9A9A9 .
Gets the system-defined color that has an ARGB value of #FF006400 .
Gets the system-defined color that has an ARGB value of #FFBDB76B .
Gets the system-defined color that has an ARGB value of #FF8B008B .
Gets the system-defined color that has an ARGB value of #FF556B2F .
Gets the system-defined color that has an ARGB value of #FFFF8C00 .
Gets the system-defined color that has an ARGB value of #FF9932CC .
Gets the system-defined color that has an ARGB value of #FF8B0000 .
Gets the system-defined color that has an ARGB value of #FFE9967A .
Gets the system-defined color that has an ARGB value of #FF8FBC8F .
Gets the system-defined color that has an ARGB value of #FF483D8B .
Gets the system-defined color that has an ARGB value of #FF2F4F4F .
Gets the system-defined color that has an ARGB value of #FF00CED1 .
Gets the system-defined color that has an ARGB value of #FF9400D3 .
Gets the system-defined color that has an ARGB value of #FFFF1493 .
Gets the system-defined color that has an ARGB value of #FF00BFFF .
Gets the system-defined color that has an ARGB value of #FF696969 .
Gets the system-defined color that has an ARGB value of #FF1E90FF .
Gets the system-defined color that has an ARGB value of #FFB22222 .
Gets the system-defined color that has an ARGB value of #FFFFFAF0 .
Gets the system-defined color that has an ARGB value of #FF228B22 .
Gets the system-defined color that has an ARGB value of #FFFF00FF .
Gets the system-defined color that has an ARGB value of #FFDCDCDC .
Gets the system-defined color that has an ARGB value of #FFF8F8FF .
Gets the system-defined color that has an ARGB value of #FFFFD700 .
Gets the system-defined color that has an ARGB value of #FFDAA520 .
Gets the system-defined color that has an ARGB value of #FF808080 .
Gets the system-defined color that has an ARGB value of #FF008000 .
Gets the system-defined color that has an ARGB value of #FFADFF2F .
Gets the system-defined color that has an ARGB value of #FFF0FFF0 .
Gets the system-defined color that has an ARGB value of #FFFF69B4 .
Gets the system-defined color that has an ARGB value of #FFCD5C5C .
Gets the system-defined color that has an ARGB value of #FF4B0082 .
Gets the system-defined color that has an ARGB value of #FFFFFFF0 .
Gets the system-defined color that has an ARGB value of #FFF0E68C .
Gets the system-defined color that has an ARGB value of #FFE6E6FA .
Gets the system-defined color that has an ARGB value of #FFFFF0F5 .
Gets the system-defined color that has an ARGB value of #FF7CFC00 .
Gets the system-defined color that has an ARGB value of #FFFFFACD .
Gets the system-defined color that has an ARGB value of #FFADD8E6 .
Gets the system-defined color that has an ARGB value of #FFF08080 .
Gets the system-defined color that has an ARGB value of #FFE0FFFF .
Gets the system-defined color that has an ARGB value of #FFFAFAD2 .
Gets the system-defined color that has an ARGB value of #FFD3D3D3 .
Gets the system-defined color that has an ARGB value of #FF90EE90 .
Gets the system-defined color that has an ARGB value of #FFFFB6C1 .
Gets the system-defined color that has an ARGB value of #FFFFA07A .
Gets the system-defined color that has an ARGB value of #FF20B2AA .
Gets the system-defined color that has an ARGB value of #FF87CEFA .
Gets the system-defined color that has an ARGB value of #FF778899 .
Gets the system-defined color that has an ARGB value of #FFB0C4DE .
Gets the system-defined color that has an ARGB value of #FFFFFFE0 .
Gets the system-defined color that has an ARGB value of #FF00FF00 .
Gets the system-defined color that has an ARGB value of #FF32CD32 .
Gets the system-defined color that has an ARGB value of #FFFAF0E6 .
Gets the system-defined color that has an ARGB value of #FFFF00FF .
Gets the system-defined color that has an ARGB value of #FF800000 .
Gets the system-defined color that has an ARGB value of #FF66CDAA .
Gets the system-defined color that has an ARGB value of #FF0000CD .
Gets the system-defined color that has an ARGB value of #FFBA55D3 .
Gets the system-defined color that has an ARGB value of #FF9370DB .
Gets the system-defined color that has an ARGB value of #FF3CB371 .
Gets the system-defined color that has an ARGB value of #FF7B68EE .
Gets the system-defined color that has an ARGB value of #FF00FA9A .
Gets the system-defined color that has an ARGB value of #FF48D1CC .
Gets the system-defined color that has an ARGB value of #FFC71585 .
Gets the system-defined color that has an ARGB value of #FF191970 .
Gets the system-defined color that has an ARGB value of #FFF5FFFA .
Gets the system-defined color that has an ARGB value of #FFFFE4E1 .
Gets the system-defined color that has an ARGB value of #FFFFE4B5 .
Gets the system-defined color that has an ARGB value of #FFFFDEAD .
Gets the system-defined color that has an ARGB value of #FF000080 .
Gets the system-defined color that has an ARGB value of #FFFDF5E6 .
Gets the system-defined color that has an ARGB value of #FF808000 .
Gets the system-defined color that has an ARGB value of #FF6B8E23 .
Gets the system-defined color that has an ARGB value of #FFFFA500 .
Gets the system-defined color that has an ARGB value of #FFFF4500 .
Gets the system-defined color that has an ARGB value of #FFDA70D6 .
Gets the system-defined color that has an ARGB value of #FFEEE8AA .
Gets the system-defined color that has an ARGB value of #FF98FB98 .
Gets the system-defined color that has an ARGB value of #FFAFEEEE .
Gets the system-defined color that has an ARGB value of #FFDB7093 .
Gets the system-defined color that has an ARGB value of #FFFFEFD5 .
Gets the system-defined color that has an ARGB value of #FFFFDAB9 .
Gets the system-defined color that has an ARGB value of #FFCD853F .
Gets the system-defined color that has an ARGB value of #FFFFC0CB .
Gets the system-defined color that has an ARGB value of #FFDDA0DD .
Gets the system-defined color that has an ARGB value of #FFB0E0E6 .
Gets the system-defined color that has an ARGB value of #FF800080 .
Gets the system-defined color that has an ARGB value of #FFFF0000 .
Gets the system-defined color that has an ARGB value of #FFBC8F8F .
Gets the system-defined color that has an ARGB value of #FF4169E1 .
Gets the system-defined color that has an ARGB value of #FF8B4513 .
Gets the system-defined color that has an ARGB value of #FFFA8072 .
Gets the system-defined color that has an ARGB value of #FFF4A460 .
Gets the system-defined color that has an ARGB value of #FF2E8B57 .
Gets the system-defined color that has an ARGB value of #FFFFF5EE .
Gets the system-defined color that has an ARGB value of #FFA0522D .
Gets the system-defined color that has an ARGB value of #FFC0C0C0 .
Gets the system-defined color that has an ARGB value of #FF87CEEB .
Gets the system-defined color that has an ARGB value of #FF6A5ACD .
Gets the system-defined color that has an ARGB value of #FF708090 .
Gets the system-defined color that has an ARGB value of #FFFFFAFA .
Gets the system-defined color that has an ARGB value of #FF00FF7F .
Gets the system-defined color that has an ARGB value of #FF4682B4 .
Gets the system-defined color that has an ARGB value of #FFD2B48C .
Gets the system-defined color that has an ARGB value of #FF008080 .
Gets the system-defined color that has an ARGB value of #FFD8BFD8 .
Gets the system-defined color that has an ARGB value of #FFFF6347 .
Gets the system-defined color that has an ARGB value of #00FFFFFF .
Gets the system-defined color that has an ARGB value of #FF40E0D0 .
Gets the system-defined color that has an ARGB value of #FFEE82EE .
Gets the system-defined color that has an ARGB value of #FFF5DEB3 .
Gets the system-defined color that has an ARGB value of #FFFFFFFF .
Gets the system-defined color that has an ARGB value of #FFF5F5F5 .
Gets the system-defined color that has an ARGB value of #FFFFFF00 .
Gets the system-defined color that has an ARGB value of #FF9ACD32 .
Methods
Determines whether the specified object is equal to the current object.
Serves as the default hash function.
Gets the Type of the current instance.
Creates a shallow copy of the current Object.
Returns a string that represents the current object.
