0 out of 1 rated this helpful - Rate this topic

Color.FromArgb Method

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

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)
public static Color FromArgb(
	byte a,
	byte r,
	byte g,
	byte b
)

Parameters

a
Type: System.Byte
The alpha channel, A, of the new color. The value must be between 0 and 255.
r
Type: System.Byte
The red channel, R, of the new color. The value must be between 0 and 255.
g
Type: System.Byte
The green channel, G, of the new color. The value must be between 0 and 255.
b
Type: System.Byte
The blue channel, B, of the new color. The value must be between 0 and 255.

Return Value

Type: System.Windows.Media.Color
A Color structure with the specified values.

The FromArgb method requires you to specify the alpha channel; the Silverlight 5 implementation of Color does not support Color.FromRgb. The alpha channel of a color determines the amount of transparency of the color. An alpha value of 255 indicates that the color is completely opaque, and a value of 0 indicates that the color is completely transparent.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ