Aplicativos do Windows
Recolher sumário
Expandir sumário

Color structure

[This documentation is preliminary and is subject to change.]

Describes a color in terms of alpha, red, green, and blue channels.

Syntax


var color = {
    a : /* Your value */,
    b : /* Your value */,
    g : /* Your value */,
    r : /* Your value */
}


<Color ...>predefinedColor</Color>
- or -
<Color ...>#rgb</Color>
- or -
<Color ...>#argb</Color>
- or -
<Color ...>#rrggbb</Color>
- or -
<Color ...>#aarrggbb</Color>
- or -
<Color ...>sc#scR,scG,scB</Color>
- or -
<Color ...>sc# scA,scR,scG,scB</Color>


<object property="predefinedColor"/>
- or -
<object property="#rgb"/>
- or -
<object property="#argb"/>
- or -
<object property="#rrggbb"/>
- or -
<object property="#aarrggbb"/>
- or -
<object property="sc#scR,scG,scB"/>
- or -
<object property="sc# scA,scR,scG,scB"/>

XAML Values

predefinedColor

One of the colors predefined by the Colors class (static properties), or one of the other named colors.

rgb

A three-character hexadecimal value. The first character specifies the color's R value, the second character specifies the G value, and the third character specifies the B value. For example, 00F.

argb

A four-character hexadecimal value. The first character specifies the color's A value, the second character specifies its R value, the third character specifies the G value, and the fourth character specifies its B value. For example, F00F.

rrggbb

A six-character hexadecimal value. The first two characters 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-character hexadecimal value. The first two characters 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.

scA

The color's ScA value as a value between 0 and 1. ScA is not exposed as a Color property directly.

scR

The color's ScR value as a value between 0 and 1. ScR is not exposed as a Color property directly

scG

The color's ScG value as a value between 0 and 1. ScG is not exposed as a Color property directly

scB

The color's ScB value as a value between 0 and 1. ScB is not exposed as a Color property directly

Attributes

VersionAttribute(NTDDI_WIN8)

Members

The Color structure has these types of members:

Fields

The Color structure has these fields.

FieldData typeDescription
A | a

Number [JavaScript] | System.Byte [.NET] | uint8 [C++]

Gets or sets the sRGB alpha channel value of the color.

B | b

Number [JavaScript] | System.Byte [.NET] | uint8 [C++]

Gets or sets the sRGB blue channel value of the color.

G | g

Number [JavaScript] | System.Byte [.NET] | uint8 [C++]

Gets or sets the sRGB green channel value of the color.

R | r

Number [JavaScript] | System.Byte [.NET] | uint8 [C++]

Gets or sets the sRGB red channel value of the color.

 

Methods

The Color structure has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
FromArgb Creates a new Color structure by using the specified sRGB alpha channel and color channel values.

 

Properties

The Color structure has these properties.

PropertyAccess typeDescription

A

Read/writeGets or sets the sRGB alpha channel value of the color.

B

Read/writeGets or sets the sRGB blue channel value of the color.

G

Read/writeGets or sets the sRGB green channel value of the color.

R

Read/writeGets or sets the sRGB red channel value of the color.

 

Requirements

Minimum supported client

Windows 8 Consumer Preview

Minimum supported server

Windows Server 8 Beta

Namespace

Windows.UI
Windows::UI [C++]

Metadata

Windows.winmd

 

 

Build date: 2/10/2012

Contribuições da comunidade

Mostrar:
© 2017 Microsoft