Methods for color variables
Use methods for color variables to manipulate the color of text and other objects.
Methods
Method | Description | Parameters | Result type |
Equals | Compares a value to the variable value. | Color value | Boolean |
FromArgb (1 parameter) | Creates a Color structure from a 32-bit ARGB value. | Int32 val | Color |
FromArgb (2 parameters) | Creates a Color structure from the specified Color structure, but with the new specified alpha value. Although this method allows a 32-bit value to be passed for the alpha value, the value is limited to 8 bits. | Int32 alpha | Color |
FromArgb (3 parameters) | Creates a Color structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). 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. | Int32 red, Int32 green, Int32 blue | Color |
FromArgb (4 parameters) | Creates a Color structure from the four ARGB component (alpha, red, green, and blue) values. Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits. | Int32 alpha, Int32 red, Int32 green, Int32 blue | Color |
FromKnownColor | Creates a Color structure from the specified predefined color. | KnownColor value | Color |
FromName | Creates a Color structure from the specified name of a predefined color. | string value: Valid names are the names of the elements of the KnownColor enumeration. | Color |
GetBrightness | Gets the hue-saturation-lightness (HSL) lightness value for this Color structure. | Double | |
GetHue | Gets the hue-saturation-lightness (HSL) hue value, in degrees, for this Color structure. | Double | |
GetSaturation | Gets the hue-saturation-lightness (HSL) saturation value for this Color structure. | Double | |
ResetState | Resets component properties to initial values. | ||
ToArgb | The 32-bit ARGB value of this Color. | Int32 | |
ToKnownColor | Gets the KnownColor value of this Color structure. | KnownColor | KnownColor |
ToString | Converts this Color structure to a human-readable string. | String | String |
Previous topic Methods for character variables Next topic Methods for font variables