xtd 0.2.0
Loading...
Searching...
No Matches

◆ from_known_color()

static xtd::drawing::color xtd::drawing::color::from_known_color ( xtd::drawing::known_color  color)
static

Creates a xtd::drawing::color class 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.

Parameters
alphaThe alpha value for the new xtd::drawing::color. Valid values are 0 through 255.
redThe red component. Valid values are 0 through 255.
greenThe green component. Valid values are 0 through 255.
blueThe blue component. Valid values are 0 through 255.
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.
Exceptions
std::invalid_argumentcolor is not a known_color.
Examples
The following code example is designed for use with Windows Forms, and it requires xtd::forms::paint_event_args, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions: