FromArgb

FromArgb(int)

Creates a Color structure from a 32-bit ARGB value.

public static Color FromArgb(int argb)
Parameter Type Description
argb Int32 A value specifying the 32-bit ARGB value.

Return Value

The Color structure that this method creates.

See Also


FromArgb(int, Color)

Creates a Color structure from the specified Color structure, but with the new specified alpha value.

public static Color FromArgb(int alpha, Color baseColor)
Parameter Type Description
alpha Int32 The alpha value for the new Color. Valid values are 0 through 255.
baseColor Color The Color from which to create the new Color.

Return Value

The Color that this method creates.

Exceptions

exception condition
ArgumentOutOfRangeException Alpha is less than 0 or greater than 255.

Remarks

Although this method allows a 32-bit value to be passed for the alpha value, the value is limited to 8 bits.

See Also


FromArgb(int, int, int)

Creates a Color structure from the specified 8-bit color values (red, green, and blue) and the alpha value is implicitly 255 (fully opaque).

public static Color FromArgb(int red, int green, int blue)
Parameter Type Description
red Int32 The red component value for the new Color. Valid values are 0 through 255.
green Int32 The green component value for the new Color. Valid values are 0 through 255.
blue Int32 The blue component value for the new Color. Valid values are 0 through 255.

Return Value

The Color that this method creates.

Exceptions

exception condition
ArgumentOutOfRangeException Red, green, or blue is less than 0 or greater than 255.

Remarks

Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits.

See Also


FromArgb(int, int, int, int)

Creates a Color structure from the four ARGB component (alpha, red, green, and blue) values.

public static Color FromArgb(int alpha, int red, int green, int blue)
Parameter Type Description
alpha Int32 The alpha component value for the new Color. Valid values are 0 through 255.
red Int32 The red component value for the new Color. Valid values are 0 through 255.
green Int32 The green component value for the new Color. Valid values are 0 through 255.
blue Int32 The blue component value for the new Color. Valid values are 0 through 255.

Return Value

The Color that this method creates.

Exceptions

exception condition
ArgumentOutOfRangeException Red, green, or blue is less than 0 or greater than 255.

Remarks

Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits.

See Also