Color 구조체
정의
알파, 빨간색, 녹색 및 파란색 채널로 색을 설명합니다.Describes a color in terms of alpha, red, green, and blue channels.
public value class Color : IEquatable<System::Windows::Media::Color>, IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.ColorConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public struct Color : IEquatable<System.Windows.Media.Color>, IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.ColorConverter))>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)>]
type Color = struct
interface IFormattable
Public Structure Color
Implements IEquatable(Of Color), IFormattable
- 상속
- 특성
- 구현
예제
이 예제에서는 색을 파란색 만들려면 sRGB 및 ScRGB 색 프로필 값을 사용 하는 방법을 보여 줍니다.This example shows how to use sRGB, ScRGB, and color profile values to create the color blue.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<StackPanel Margin="20">
<!-- This rectangle fill uses a Color with ScRGB values to
create a completely opaque blue. -->
<Rectangle Width="50" Height="50" Margin="10">
<Rectangle.Fill>
<SolidColorBrush>
<SolidColorBrush.Color>
<!-- Describes the brush's color using
ScRGB values. Each value has a range of 0-1. -->
<Color ScA="1.0" ScR="0.0" ScG="0.0" ScB="1.0" />
</SolidColorBrush.Color>
</SolidColorBrush>
</Rectangle.Fill>
</Rectangle>
<!-- This rectangle fill uses a Color with sRGB values to
create a completely opaque blue. -->
<Rectangle Width="50" Height="50" Margin="10">
<Rectangle.Fill>
<SolidColorBrush>
<SolidColorBrush.Color>
<!-- Describes the brush's color using
sRGB values. Each value is a byte with range of 0-255. -->
<Color A="255" R="0" G="0" B="255" />
</SolidColorBrush.Color>
</SolidColorBrush>
</Rectangle.Fill>
</Rectangle>
<!-- This rectangle fill uses the sRGB color profile and values to
create a complete opaque blue. -->
<Rectangle Width="50" Height="50" Margin="10">
<Rectangle.Fill>
<SolidColorBrush Color="ContextColor
file://C:/WINDOWS/system32/spool/drivers/color/sRGB%20Color%20Space%20Profile.icm
1.0,0.0,0.0,1.0"/>
</Rectangle.Fill>
</Rectangle>
</StackPanel>
</Page>
설명
XAML 특성 사용XAML Attribute Usage
<object property="predefinedColor"/>
- or -
<object property="#rgb"/>
- or -
<object property="#argb"/>
- or -
<object property="#rrggbb"/>
- or -
<object property="#aarrggbb"/>
- or -
<object property="sc# scA,scR,scG,scB"/>
- or -
<object property="ContextColor profileUri alphaValue,colorValue"/>
XAML 값XAML Values
predefinedColorpredefinedColor
에 의해 미리 정의 된 색 중 하나는 Colors 클래스입니다.One of the colors predefined by the Colors class.
rgbrgb
세 자리 16 진수입니다.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
.
argbargb
4 자리 16 진수입니다.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
.
rrggbbrrggbb
6 자리 16 진수입니다.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
.
aarrggbbaarrggbb
8 자리 16 진수입니다.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
.
iscA
System.Single
색의 ScA 값입니다.The color's ScA value.
scRscR
System.Single
색의 ScR 값입니다.The color's ScR value.
scGscG
System.Single
색의 ScG 값입니다.The color's ScG value.
scBscB
System.Single
색의 ScB 값입니다.The color's ScB value.
profileUriprofileUri
System.Uri
합니다 ICC(International Color Consortium)International Color Consortium (ICC) 또는 ICM(이미지 색 관리)Image Color Management (ICM) 색 프로필입니다.The ICC(International Color Consortium)International Color Consortium (ICC) or ICM(이미지 색 관리)Image Color Management (ICM) color profile.
alphaValuealphaValue
System.Single
알파 채널 색 값입니다.The alpha channel color value. 값 범위는 0.0 ~ 1.0.The value range is 0.0 to 1.0.
colorValuecolorValue
System.Single
색상 채널 색 프로필을 나타내는 3 ~ 8 개의 값의 쉼표로 구분 된 목록입니다.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.
속성
A |
색의 |
B |
색의 |
ColorContext |
색의 ICC(International Color Consortium)International Color Consortium (ICC) 또는 ICM(이미지 색 관리)Image Color Management (ICM) 색 프로필을 가져옵니다.Gets the ICC(International Color Consortium)International Color Consortium (ICC) or ICM(이미지 색 관리)Image Color Management (ICM) color profile of the color. |
G |
색의 |
R |
색의 |
ScA |
색의 |
ScB |
색의 ScRGB 파랑 채널 값을 가져오거나 설정합니다.Gets or sets the ScRGB blue channel value of the color. |
ScG |
색의 |
ScR |
색의 |
메서드
Add(Color, Color) | |
AreClose(Color, Color) |
두 Color 구조체가 부분적으로 같은지 여부를 비교합니다.Compares two Color structures for fuzzy equality. |
Clamp() |
색의 |
Equals(Color) |
지정한 Color 구조체가 이 색과 같은지 여부를 테스트합니다.Tests whether the specified Color structure is identical to this color. |
Equals(Color, Color) |
두 Color 구조체가 같은지 여부를 테스트합니다.Tests whether two Color structures are identical. |
Equals(Object) |
지정된 개체가 Color 구조체인지 여부 및 이 구조체가 이 색상과 동일한지 여부를 테스트합니다.Tests whether the specified object is a Color structure and is equivalent to this color. |
FromArgb(Byte, Byte, Byte, Byte) |
지정한 |
FromAValues(Single, Single[], Uri) |
지정한 알파 채널, 색 채널 값 및 색 프로필을 사용하여 새 Color 구조체를 만듭니다.Creates a new Color structure by using the specified alpha channel, color channel values, and color profile. |
FromRgb(Byte, Byte, Byte) |
지정한 |
FromScRgb(Single, Single, Single, Single) |
지정한 |
FromValues(Single[], Uri) |
지정한 색 채널 값과 색 프로필을 사용하여 새 Color 구조체를 만듭니다.Creates a new Color structure by using the specified color channel values and color profile. |
GetHashCode() |
이 Color 구조체의 해시 코드를 가져옵니다.Gets a hash code for this Color structure. |
GetNativeColorValues() |
색의 색 채널 값을 가져옵니다.Gets the color channel values of the color. |
Multiply(Color, Single) |
지정한 Color 구조체의 알파, 빨강, 파랑 및 녹색 채널에 지정한 값을 곱합니다.Multiplies the alpha, red, blue, and green channels of the specified Color structure by the specified value. |
Subtract(Color, Color) |
Color 구조체에서 Color 구조체를 뺍니다.Subtracts a Color structure from a Color structure. |
ToString() |
|
ToString(IFormatProvider) |
|
연산자
Addition(Color, Color) | |
Equality(Color, Color) |
두 Color 구조체가 같은지 여부를 테스트합니다.Tests whether two Color structures are identical. |
Inequality(Color, Color) |
두 Color 구조체가 같지 않은지 여부를 테스트합니다.Tests whether two Color structures are not identical. |
Multiply(Color, Single) |
지정한 Color 구조체의 알파, 빨강, 파랑 및 녹색 채널에 지정한 값을 곱합니다.Multiplies the alpha, red, blue, and green channels of the specified Color structure by the specified value. |
Subtraction(Color, Color) |
Color 구조체에서 Color 구조체를 뺍니다.Subtracts a Color structure from a Color structure. |
명시적 인터페이스 구현
IFormattable.ToString(String, IFormatProvider) |
지정한 형식을 사용하여 현재 인스턴스 값의 형식을 지정합니다.Formats the value of the current instance using the specified format. |