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.
Color Структура
Определение
Описывает цвет в терминах каналов альфа, красного, зеленого и синего. Describes a color in terms of alpha, red, green, and blue channels.
Примеры
В этом примере показано, как использовать значения sRGB, ScRGB и цветового профиля для создания синего цвета. This example shows how to use sRGB, ScRGB, and color profile values to create the color blue.
Комментарии
Использование атрибута XAML XAML Attribute Usage
Значения XAML XAML Values
предефинедколор predefinedColor
Один из цветов, предопределенных Colors классом. One of the colors predefined by the Colors class.
цвета rgb
Шестнадцатеричное число из трех цифр. A three-digit hexadecimal number. Первая цифра задает R значение цвета, вторая цифра — G значение, а третья цифра — B значение. The first digit specifies the color’s R value, the second digit specifies the G value, and the third digit specifies the B value. Например, 00F . For example, 00F .
ARGB argb
Шестнадцатеричное число из четырех цифр. A four-digit hexadecimal number. Первая цифра задает A значение цвета, вторая цифра указывает его R значение, следующая цифра указывает G значение, а последняя цифра указывает его B значение. 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. Например, F00F . For example, F00F .
RRGGBB rrggbb
Шестнадцатеричное число из шести цифр. A six-digit hexadecimal number. Первые две цифры задают R значение цвета, затем два значения задают его значение G , а последние два указывают его B значение. 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. Например, 0000FF . For example, 0000FF .
aarrggbb aarrggbb
Шестнадцатеричное число из восьми цифр. An eight-digit hexadecimal number. Первые две цифры задают A значение цвета, два следующих параметра задают его значение, R а следующие два указывают его значение G , а последние два указывают его B значение. 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. Например, FF0000FF . For example, FF0000FF .
ScAЗначение цвета. The color’s ScA value.
ScRЗначение цвета. The color’s ScR value.
ScGЗначение цвета. The color’s ScG value.
ScBЗначение цвета. The color’s ScB value.
Международный консорциум по цвету (ICC) International Color Consortium (ICC) ICM (Image Color Management — управление цветом изображений) Image Color Management (ICM) Профиль цвета или. The Международный консорциум по цвету (ICC) International Color Consortium (ICC) or ICM (Image Color Management — управление цветом изображений) Image Color Management (ICM) color profile.
Значение цвета альфа-канала. The alpha channel color value. Диапазон значений — от 0,0 до 1,0. 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. Диапазон значений — от 0,0 до 1,0. The value range is 0.0 to 1.0.
Свойства
Получает или задает значение альфа-канала цвета sRGB . Gets or sets the sRGB alpha channel value of the color.
Получает или задает значение синего канала цвета sRGB . Gets or sets the sRGB blue channel value of the color.
Получает цветовой профиль Международный консорциум по цвету (ICC) International Color Consortium (ICC) или ICM (Image Color Management — управление цветом изображений) Image Color Management (ICM) цвета. Gets the Международный консорциум по цвету (ICC) International Color Consortium (ICC) or ICM (Image Color Management — управление цветом изображений) Image Color Management (ICM) color profile of the color.
Получает или задает значение зеленого канала цвета sRGB . Gets or sets the sRGB green channel value of the color.
Получает или задает значение красного канала цвета sRGB . Gets or sets the sRGB red channel value of the color.
Получает или задает значение альфа-канала цвета ScRGB . Gets or sets the ScRGB alpha channel value of the color.
Получает или задает значение синего канала ScRGB цвета. Gets or sets the ScRGB blue channel value of the color.
Получает или задает значение зеленого канала цвета ScRGB . Gets or sets the ScRGB green channel value of the color.
Получает или задает значение красного канала цвета ScRGB . Gets or sets the ScRGB red channel value of the color.
Методы
Складывает две структуры Color. Adds two Color structures.
Сравнивает две структуры Color на предмет их нечеткого равенства. Compares two Color structures for fuzzy equality.
Присваивает каналам ScRGB цвета значения в диапазоне от 0 до 1, если они находятся за пределами этого диапазона. Sets the ScRGB channels of the color to within the gamut of 0 to 1, if they are outside that range.
Проверяет, идентична ли заданная структура Color этому цвету. Tests whether the specified Color structure is identical to this color.
Проверяет идентичность двух структур Color. Tests whether two Color structures are identical.
Проверяет, является ли указанный объект структурой Color, эквивалентной этому цвету. Tests whether the specified object is a Color structure and is equivalent to this color.
Создает новую структуру Color с использованием заданных значений альфа-канала и цветовых каналов sRGB . Creates a new Color structure by using the specified sRGB alpha channel and color channel values.
Создает новую структуру Color с использованием заданного альфа-канала, значений цветовых каналов и цветового профиля. Creates a new Color structure by using the specified alpha channel, color channel values, and color profile.
Создает новую структуру Color с использованием заданных значений цветовых каналов sRGB . Creates a new Color structure by using the specified sRGB color channel values.
Создает новую структуру Color с использованием заданных значений альфа-канала и цветовых каналов ScRGB . Creates a new Color structure by using the specified ScRGB alpha channel and color channel values.
Создает новую структуру Color с использованием заданных значений цветовых каналов и цветового профиля. Creates a new Color structure by using the specified color channel values and color profile.
Получает хэш-код для структуры Color. Gets a hash code for this Color structure.
Получает значения цветовых каналов цвета. Gets the color channel values of the color.
Умножает альфа, красный, синий и зеленый каналы заданной структуры Color на заданное значение. Multiplies the alpha, red, blue, and green channels of the specified Color structure by the specified value.
Вычитает структуру Color из структуры Color. Subtracts a Color structure from a Color structure.
Создает строковое представление цвета с использованием каналов sRGB . Creates a string representation of the color using the sRGB channels.
Создает строковое представление цвета с использованием каналов sRGB и заданного поставщика формата. Creates a string representation of the color by using the sRGB channels and the specified format provider.
Операторы
Складывает две структуры Color. Adds two Color structures.
Проверяет идентичность двух структур Color. Tests whether two Color structures are identical.
Проверяет, действительно ли две структуры Color являются не идентичными. Tests whether two Color structures are not identical.
Умножает альфа, красный, синий и зеленый каналы заданной структуры Color на заданное значение. Multiplies the alpha, red, blue, and green channels of the specified Color structure by the specified value.
Вычитает структуру Color из структуры Color. Subtracts a Color structure from a Color structure.
Явные реализации интерфейса
Форматирует значение текущего экземпляра с использованием указанного формата. Formats the value of the current instance using the specified format.
