xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Static Public Attributes | Public Member Functions | Static Public Member Functions | List of all members
xtd::drawing::color Class Reference

#include <color.h>

Definition

Represents an ARGB (alpha, red, green, blue) color.

Namespace
xtd::drawing
Library
xtd.drawing
Remarks
Named colors are represented by using the properties of the xtd::drawing::color structure. For more information about these colors, see Colors by Name.
The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). Each of the four components is a number from 0 through 255, with 0 representing no intensity and 255 representing full intensity. The alpha component specifies the transparency of the color: 0 is fully transparent, and 255 is fully opaque. To determine the alpha, red, green, or blue component of a color, use the A, R, G, or B property, respectively. You can create a custom color by using one of the from_argb methods
Examples
The following code example demonstrates the A, R, G, and B properties of a xtd::drawing::color, and the Implicit(size to size_f) member.
This example is designed to be used with a Windows Form (xtd::forms). Paste the code into the form and call the show_properties_of_slate_blue method from the form's paint event-handling method, passing e as paint_event_args.
void show_properties_of_slate_blue(xtd::forms::paint_event_args& e) {
byte g = slate_blue.g();
byte b = slate_blue.b();
byte r = slate_blue.r();
byte a = slate_blue.a();
string text = xtd::ustring::format("Slate blue has these ARGB values: alpha:{0}, red:{1}, green: {2}, blue {3}", a, r, g, b);
}
color()=default
Initialize a new instance of xtd::drawing::color class.
static xtd::drawing::color from_name(const xtd::ustring &name)
Creates a xtd::drawing::color class from the specified name of a predefined color.
static const xtd::drawing::color slate_blue
Gets a system-defined color that has an ARGB value of 0xFF6A5ACD. This field is constant.
Definition: color.h:423
uint8_t b() const
Gets the blue component value of this xtd::drawing::color class.
Definition: color.h:516
uint8_t r() const
Gets the red component value of this xtd::drawing::color class.
Definition: color.h:579
uint8_t g() const
Gets the green component value of this xtd::drawing::color class.
Definition: color.h:535
uint8_t a() const
Gets the alpha component value of this xtd::drawing::color class.
Definition: color.h:497
Defines a particular format for text, including font face, size, and style attributes....
Definition: font.h:39
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition: point_f.h:26
Stores a set of four floating-points that represent the location and size of a rectangle.
Definition: rectangle_f.h:28
Defines a xtd::drawing::brush of a single color. Brushes are used to fill graphics shapes,...
Definition: solid_brush.h:22
Provides data for the paint event.
Definition: paint_event_args.h:26
static ustring format(const ustring &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition: ustring.h:689
size_t size
Represents a size of any object in bytes.
Definition: types.h:171
@ e
The E key.

Inherits xtd::object.

Static Public Attributes

static const xtd::drawing::color alice_blue
 Gets a system-defined color that has an ARGB value of 0xFFF0F8FF. This field is constant. More...
 
static const xtd::drawing::color antique_white
 Gets a system-defined color that has an ARGB value of 0xFFFAEBD7. This field is constant. More...
 
static const xtd::drawing::color aqua
 Gets a system-defined color that has an ARGB value of 0xFF00FFFF. This field is constant. More...
 
static const xtd::drawing::color aquamarine
 Gets a system-defined color that has an ARGB value of 0xFF7FFFD4. This field is constant. More...
 
static const xtd::drawing::color azure
 Gets a system-defined color that has an ARGB value of 0xFFF0FFFF. This field is constant. More...
 
static const xtd::drawing::color beige
 Gets a system-defined color that has an ARGB value of 0xFFF5F5DC. This field is constant. More...
 
static const xtd::drawing::color bisque
 Gets a system-defined color that has an ARGB value of 0xFFFFE4C4. This field is constant. More...
 
static const xtd::drawing::color black
 Gets a system-defined color that has an ARGB value of 0xFF000000. This field is constant. More...
 
static const xtd::drawing::color blanched_almond
 Gets a system-defined color that has an ARGB value of 0xFFFFEBCD. This field is constant. More...
 
static const xtd::drawing::color blue
 Gets a system-defined color that has an ARGB value of 0xFF0000FF. This field is constant. More...
 
static const xtd::drawing::color blue_violet
 Gets a system-defined color that has an ARGB value of 0xFF8A2BE2. This field is constant. More...
 
static const xtd::drawing::color brown
 Gets a system-defined color that has an ARGB value of 0xFFA52A2A. This field is constant. More...
 
static const xtd::drawing::color burly_wood
 Gets a system-defined color that has an ARGB value of 0xFFDEB887. This field is constant. More...
 
static const xtd::drawing::color cadet_blue
 Gets a system-defined color that has an ARGB value of 0xFF5F9EA0. This field is constant. More...
 
static const xtd::drawing::color chartreuse
 Gets a system-defined color that has an ARGB value of 0xFF7FFF00. This field is constant. More...
 
static const xtd::drawing::color chocolate
 Gets a system-defined color that has an ARGB value of 0xFFD2691E. This field is constant. More...
 
static const xtd::drawing::color coral
 Gets a system-defined color that has an ARGB value of 0xFFFF7F50. This field is constant. More...
 
static const xtd::drawing::color cornflower_blue
 Gets a system-defined color that has an ARGB value of 0xFF6495ED. This field is constant. More...
 
static const xtd::drawing::color cornsilk
 Gets a system-defined color that has an ARGB value of 0xFFFFF8DC. This field is constant. More...
 
static const xtd::drawing::color crimson
 Gets a system-defined color that has an ARGB value of 0xFFDC143C. This field is constant. More...
 
static const xtd::drawing::color cyan
 Gets a system-defined color that has an ARGB value of 0xFF00FFFF. This field is constant. More...
 
static const xtd::drawing::color dark_blue
 Gets a system-defined color that has an ARGB value of 0xFF00008B. This field is constant. More...
 
static const xtd::drawing::color dark_cyan
 Gets a system-defined color that has an ARGB value of 0xFF008B8B. This field is constant. More...
 
static const xtd::drawing::color dark_goldenrod
 Gets a system-defined color that has an ARGB value of 0xFFB8860B. This field is constant. More...
 
static const xtd::drawing::color dark_gray
 Gets a system-defined color that has an ARGB value of 0xFFA9A9A9. This field is constant. More...
 
static const xtd::drawing::color dark_green
 Gets a system-defined color that has an ARGB value of 0xFF006400. This field is constant. More...
 
static const xtd::drawing::color dark_khaki
 Gets a system-defined color that has an ARGB value of 0xFFBDB76B. This field is constant. More...
 
static const xtd::drawing::color dark_magenta
 Gets a system-defined color that has an ARGB value of 0xFF8B008B. This field is constant. More...
 
static const xtd::drawing::color dark_olive_green
 Gets a system-defined color that has an ARGB value of 0xFF556B2F. This field is constant. More...
 
static const xtd::drawing::color dark_orange
 Gets a system-defined color that has an ARGB value of 0xFFFF8C00. This field is constant. More...
 
static const xtd::drawing::color dark_orchid
 Gets a system-defined color that has an ARGB value of 0xFF9932CC. This field is constant. More...
 
static const xtd::drawing::color dark_red
 Gets a system-defined color that has an ARGB value of 0xFF8B0000. This field is constant. More...
 
static const xtd::drawing::color dark_salmon
 Gets a system-defined color that has an ARGB value of 0xFFE9967A. This field is constant. More...
 
static const xtd::drawing::color dark_sea_green
 Gets a system-defined color that has an ARGB value of 0xFF8FBC8B. This field is constant. More...
 
static const xtd::drawing::color dark_slate_blue
 Gets a system-defined color that has an ARGB value of 0xFF483D8B. This field is constant. More...
 
static const xtd::drawing::color dark_slate_gray
 Gets a system-defined color that has an ARGB value of 0xFF2F4F4F. This field is constant. More...
 
static const xtd::drawing::color dark_turquoise
 Gets a system-defined color that has an ARGB value of 0xFF00CED1. This field is constant. More...
 
static const xtd::drawing::color dark_violet
 Gets a system-defined color that has an ARGB value of 0xFF9400D3. This field is constant. More...
 
static const xtd::drawing::color deep_pink
 Gets a system-defined color that has an ARGB value of 0xFFFF1493. This field is constant. More...
 
static const xtd::drawing::color deep_sky_blue
 Gets a system-defined color that has an ARGB value of 0xFF00BFFF. This field is constant. More...
 
static const xtd::drawing::color dim_gray
 Gets a system-defined color that has an ARGB value of 0xFF696969. This field is constant. More...
 
static const xtd::drawing::color dodger_blue
 Gets a system-defined color that has an ARGB value of 0xFF1E90FF. This field is constant. More...
 
static const xtd::drawing::color empty
 Represents a color that is null. More...
 
static const xtd::drawing::color firebrick
 Gets a system-defined color that has an ARGB value of 0xFFB22222. This field is constant. More...
 
static const xtd::drawing::color floral_white
 Gets a system-defined color that has an ARGB value of 0xFFFFFAF0. This field is constant. More...
 
static const xtd::drawing::color forest_green
 Gets a system-defined color that has an ARGB value of 0xFF228B22. This field is constant. More...
 
static const xtd::drawing::color fuchsia
 Gets a system-defined color that has an ARGB value of 0xFFFF00FF. This field is constant. More...
 
static const xtd::drawing::color gainsboro
 Gets a system-defined color that has an ARGB value of 0xFFDCDCDC. This field is constant. More...
 
static const xtd::drawing::color ghost_white
 Gets a system-defined color that has an ARGB value of 0xFFF8F8FF. This field is constant. More...
 
static const xtd::drawing::color gold
 Gets a system-defined color that has an ARGB value of 0xFFFFD700. This field is constant. More...
 
static const xtd::drawing::color goldenrod
 Gets a system-defined color that has an ARGB value of 0xFFDAA520. This field is constant. More...
 
static const xtd::drawing::color gray
 Gets a system-defined color that has an ARGB value of 0xFF808080. This field is constant. More...
 
static const xtd::drawing::color green
 Gets a system-defined color that has an ARGB value of 0xFF008000. This field is constant. More...
 
static const xtd::drawing::color green_yellow
 Gets a system-defined color that has an ARGB value of 0xFFADFF2F. This field is constant. More...
 
static const xtd::drawing::color honeydew
 Gets a system-defined color that has an ARGB value of 0xFFF0FFF0. This field is constant. More...
 
static const xtd::drawing::color hot_pink
 Gets a system-defined color that has an ARGB value of 0xFFFF69B4. This field is constant. More...
 
static const xtd::drawing::color indian_red
 Gets a system-defined color that has an ARGB value of 0xFFCD5C5C. This field is constant. More...
 
static const xtd::drawing::color indigo
 Gets a system-defined color that has an ARGB value of 0xFF4B0082. This field is constant. More...
 
static const xtd::drawing::color ivory
 Gets a system-defined color that has an ARGB value of 0xFFFFFFF0. This field is constant. More...
 
static const xtd::drawing::color khaki
 Gets a system-defined color that has an ARGB value of 0xFFF0E68C. This field is constant. More...
 
static const xtd::drawing::color lavender
 Gets a system-defined color that has an ARGB value of 0xFFE6E6FA. This field is constant. More...
 
static const xtd::drawing::color lavender_blush
 Gets a system-defined color that has an ARGB value of 0xFFFFF0F5. This field is constant. More...
 
static const xtd::drawing::color lawn_green
 Gets a system-defined color that has an ARGB value of 0xFF7CFC00. This field is constant. More...
 
static const xtd::drawing::color lemon_chiffon
 Gets a system-defined color that has an ARGB value of 0xFFFFFACD. This field is constant. More...
 
static const xtd::drawing::color light_blue
 Gets a system-defined color that has an ARGB value of 0xFFADD8E6. This field is constant. More...
 
static const xtd::drawing::color light_coral
 Gets a system-defined color that has an ARGB value of 0xFFF08080. This field is constant. More...
 
static const xtd::drawing::color light_cyan
 Gets a system-defined color that has an ARGB value of 0xFFE0FFFF. This field is constant. More...
 
static const xtd::drawing::color light_goldenrod_yellow
 Gets a system-defined color that has an ARGB value of 0xFFFAFAD2. This field is constant. More...
 
static const xtd::drawing::color light_gray
 Gets a system-defined color that has an ARGB value of 0xFFD3D3D3. This field is constant. More...
 
static const xtd::drawing::color light_green
 Gets a system-defined color that has an ARGB value of 0xFF90EE90. This field is constant. More...
 
static const xtd::drawing::color light_pink
 Gets a system-defined color that has an ARGB value of 0xFFFFB6C1. This field is constant. More...
 
static const xtd::drawing::color light_salmon
 Gets a system-defined color that has an ARGB value of 0xFFFFA07A. This field is constant. More...
 
static const xtd::drawing::color light_sea_green
 Gets a system-defined color that has an ARGB value of 0xFF20B2AA. This field is constant. More...
 
static const xtd::drawing::color light_sky_blue
 Gets a system-defined color that has an ARGB value of 0xFF87CEFA. This field is constant. More...
 
static const xtd::drawing::color light_slate_gray
 Gets a system-defined color that has an ARGB value of 0xFF778899. This field is constant. More...
 
static const xtd::drawing::color light_steel_blue
 Gets a system-defined color that has an ARGB value of 0xFFB0C4DE. This field is constant. More...
 
static const xtd::drawing::color light_yellow
 Gets a system-defined color that has an ARGB value of 0xFFFFFFE0. This field is constant. More...
 
static const xtd::drawing::color lime
 Gets a system-defined color that has an ARGB value of 0xFF00FF00. This field is constant. More...
 
static const xtd::drawing::color lime_green
 Gets a system-defined color that has an ARGB value of 0xFF32CD32. This field is constant. More...
 
static const xtd::drawing::color linen
 Gets a system-defined color that has an ARGB value of 0xFFFAF0E6. This field is constant. More...
 
static const xtd::drawing::color magenta
 Gets a system-defined color that has an ARGB value of 0xFFFF00FF. This field is constant. More...
 
static const xtd::drawing::color maroon
 Gets a system-defined color that has an ARGB value of 0xFF800000. This field is constant. More...
 
static const xtd::drawing::color medium_aquamarine
 Gets a system-defined color that has an ARGB value of 0xFF66CDAA. This field is constant. More...
 
static const xtd::drawing::color medium_blue
 Gets a system-defined color that has an ARGB value of 0xFF0000CD. This field is constant. More...
 
static const xtd::drawing::color medium_orchid
 Gets a system-defined color that has an ARGB value of 0xFFBA55D3. This field is constant. More...
 
static const xtd::drawing::color medium_purple
 Gets a system-defined color that has an ARGB value of 0xFF9370DB. This field is constant. More...
 
static const xtd::drawing::color medium_sea_green
 Gets a system-defined color that has an ARGB value of 0xFF3CB371. This field is constant. More...
 
static const xtd::drawing::color medium_slate_blue
 Gets a system-defined color that has an ARGB value of 0xFF7B68EE. This field is constant. More...
 
static const xtd::drawing::color medium_spring_green
 Gets a system-defined color that has an ARGB value of 0xFF00FA9A. This field is constant. More...
 
static const xtd::drawing::color medium_turquoise
 Gets a system-defined color that has an ARGB value of 0xFF48D1CC. This field is constant. More...
 
static const xtd::drawing::color medium_violet_red
 Gets a system-defined color that has an ARGB value of 0xFFC71585. This field is constant. More...
 
static const xtd::drawing::color midnight_blue
 Gets a system-defined color that has an ARGB value of 0xFF191970. This field is constant. More...
 
static const xtd::drawing::color mint_cream
 Gets a system-defined color that has an ARGB value of 0xFFF5FFFA. This field is constant. More...
 
static const xtd::drawing::color misty_rose
 Gets a system-defined color that has an ARGB value of 0xFFFFE4E1. This field is constant. More...
 
static const xtd::drawing::color moccasin
 Gets a system-defined color that has an ARGB value of 0xFFFFE4B5. This field is constant. More...
 
static const xtd::drawing::color navajo_white
 Gets a system-defined color that has an ARGB value of 0xFFFFDEAD. This field is constant. More...
 
static const xtd::drawing::color navy
 Gets a system-defined color that has an ARGB value of 0xFF000080. This field is constant. More...
 
static const xtd::drawing::color old_lace
 Gets a system-defined color that has an ARGB value of 0xFFFDF5E6. This field is constant. More...
 
static const xtd::drawing::color olive
 Gets a system-defined color that has an ARGB value of 0xFF808000. This field is constant. More...
 
static const xtd::drawing::color olive_drab
 Gets a system-defined color that has an ARGB value of 0xFF6B8E23. This field is constant. More...
 
static const xtd::drawing::color orange
 Gets a system-defined color that has an ARGB value of 0xFFFFA500. This field is constant. More...
 
static const xtd::drawing::color orange_red
 Gets a system-defined color that has an ARGB value of 0xFFFF4500. This field is constant. More...
 
static const xtd::drawing::color orchid
 Gets a system-defined color that has an ARGB value of 0xFFDA70D6. This field is constant. More...
 
static const xtd::drawing::color pale_goldenrod
 Gets a system-defined color that has an ARGB value of 0xFFEEE8AA. This field is constant. More...
 
static const xtd::drawing::color pale_green
 Gets a system-defined color that has an ARGB value of 0xFF98FB98. This field is constant. More...
 
static const xtd::drawing::color pale_turquoise
 Gets a system-defined color that has an ARGB value of 0xFFAFEEEE. This field is constant. More...
 
static const xtd::drawing::color pale_violet_red
 Gets a system-defined color that has an ARGB value of 0xFFDB7093. This field is constant. More...
 
static const xtd::drawing::color papaya_whip
 Gets a system-defined color that has an ARGB value of 0xFFFFEFD5. This field is constant. More...
 
static const xtd::drawing::color peach_puff
 Gets a system-defined color that has an ARGB value of 0xFFFFDAB9. This field is constant. More...
 
static const xtd::drawing::color peru
 Gets a system-defined color that has an ARGB value of 0xFFCD853F. This field is constant. More...
 
static const xtd::drawing::color pink
 Gets a system-defined color that has an ARGB value of 0xFFFFC0CB. This field is constant. More...
 
static const xtd::drawing::color plum
 Gets a system-defined color that has an ARGB value of 0xFFDDA0DD. This field is constant. More...
 
static const xtd::drawing::color powder_blue
 Gets a system-defined color that has an ARGB value of 0xFFB0E0E6. This field is constant. More...
 
static const xtd::drawing::color purple
 Gets a system-defined color that has an ARGB value of 0xFF800080. This field is constant. More...
 
static const xtd::drawing::color rebecca_purple
 Gets a system-defined color that has an ARGB value of 0xFF663399. This field is constant. More...
 
static const xtd::drawing::color red
 Gets a system-defined color that has an ARGB value of 0xFFFF0000. This field is constant. More...
 
static const xtd::drawing::color rosy_brown
 Gets a system-defined color that has an ARGB value of 0xFFBC8F8F. This field is constant. More...
 
static const xtd::drawing::color royal_blue
 Gets a system-defined color that has an ARGB value of 0xFF4169E1. This field is constant. More...
 
static const xtd::drawing::color saddle_brown
 Gets a system-defined color that has an ARGB value of 0xFF8B4513. This field is constant. More...
 
static const xtd::drawing::color salmon
 Gets a system-defined color that has an ARGB value of 0xFFFA8072. This field is constant. More...
 
static const xtd::drawing::color sandy_brown
 Gets a system-defined color that has an ARGB value of 0xFFF4A460. This field is constant. More...
 
static const xtd::drawing::color sea_green
 Gets a system-defined color that has an ARGB value of 0xFF2E8B57. This field is constant. More...
 
static const xtd::drawing::color sea_shell
 Gets a system-defined color that has an ARGB value of 0xFFFFF5EE. This field is constant. More...
 
static const xtd::drawing::color sienna
 Gets a system-defined color that has an ARGB value of 0xFFA0522D. This field is constant. More...
 
static const xtd::drawing::color silver
 Gets a system-defined color that has an ARGB value of 0xFFC0C0C0. This field is constant. More...
 
static const xtd::drawing::color sky_blue
 Gets a system-defined color that has an ARGB value of 0xFF87CEEB. This field is constant. More...
 
static const xtd::drawing::color slate_blue
 Gets a system-defined color that has an ARGB value of 0xFF6A5ACD. This field is constant. More...
 
static const xtd::drawing::color slate_gray
 Gets a system-defined color that has an ARGB value of 0xFF708090. This field is constant. More...
 
static const xtd::drawing::color snow
 Gets a system-defined color that has an ARGB value of 0xFFFFFAFA. This field is constant. More...
 
static const xtd::drawing::color spring_green
 Gets a system-defined color that has an ARGB value of 0xFF00FF7F. This field is constant. More...
 
static const xtd::drawing::color steel_blue
 Gets a system-defined color that has an ARGB value of 0xFF4682B4. This field is constant. More...
 
static const xtd::drawing::color tan
 Gets a system-defined color that has an ARGB value of 0xFFD2B48C. This field is constant. More...
 
static const xtd::drawing::color teal
 Gets a system-defined color that has an ARGB value of 0xFF008080. This field is constant. More...
 
static const xtd::drawing::color thistle
 Gets a system-defined color that has an ARGB value of 0xFFD8BFD8. This field is constant. More...
 
static const xtd::drawing::color tomato
 Gets a system-defined color that has an ARGB value of 0xFFFF6347. This field is constant. More...
 
static const xtd::drawing::color transparent
 Gets a system-defined color that has an ARGB value of 0x00FFFFFF. This field is constant. More...
 
static const xtd::drawing::color turquoise
 Gets a system-defined color that has an ARGB value of 0xFF40E0D0. This field is constant. More...
 
static const xtd::drawing::color violet
 Gets a system-defined color that has an ARGB value of 0xFFEE82EE. This field is constant. More...
 
static const xtd::drawing::color wheat
 Gets a system-defined color that has an ARGB value of 0xFFF5DEB3. This field is constant. More...
 
static const xtd::drawing::color white
 Gets a system-defined color that has an ARGB value of 0xFFFFFFFF. This field is constant. More...
 
static const xtd::drawing::color white_smoke
 Gets a system-defined color that has an ARGB value of 0xFFF5F5F5. This field is constant. More...
 
static const xtd::drawing::color yellow
 Gets a system-defined color that has an ARGB value of 0xFFFFFF00. This field is constant. More...
 
static const xtd::drawing::color yellow_green
 Gets a system-defined color that has an ARGB value of 0xFF9ACD32. This field is constant. More...
 

Public Member Functions

 color ()=default
 Initialize a new instance of xtd::drawing::color class. More...
 
uint8_t a () const
 Gets the alpha component value of this xtd::drawing::color class. More...
 
uint8_t b () const
 Gets the blue component value of this xtd::drawing::color class. More...
 
uint8_t g () const
 Gets the green component value of this xtd::drawing::color class. More...
 
float get_brightness () const
 Gets the hue-saturation-brightness (HSB) brightness value for this xtd::drawing::color structure. More...
 
float get_hue () const
 Gets the hue-saturation-brightness (HSB) hue value, in degrees, for this xtd::drawing::color structure. More...
 
float get_lightness () const
 Gets the hue-saturation-lightness (HSL) lightness value for this xtd::drawing::color structure. More...
 
float get_saturation () const
 Gets the hue-saturation-brightness (HSB) saturation value for this xtd::drawing::color structure. More...
 
intptr_t handle () const
 Gets the native handle of this xtd::drawing::color class. More...
 
bool is_empty () const
 Specifies whether this xtd::drawing::color class is uninitialized. More...
 
bool is_known_color () const
 Gets a value indicating whether this xtd::drawing::color structure is a predefined color. Predefined colors are represented by the elements of the xtd::drawing::known_color enumeration. More...
 
bool is_named_color () const
 Gets a value indicating whether this xtd::drawing::color structure is a named color or a member of the xtd::drawing::known_color enumeration. More...
 
bool is_system_color () const
 Gets a value indicating whether this xtd::drawing::color structure is a system color. A system color is a color that is used in a Windows display element. System colors are represented by elements of the xtd::drawing::known_color enumeration. More...
 
xtd::ustring name () const
 Gets the name of this xtd::drawing::color. More...
 
uint8_t r () const
 Gets the red component value of this xtd::drawing::color class. More...
 
uint32_t to_argb () const
 Gets the 32-bit ARGB value of this xtd::drawing::color class. More...
 
xtd::drawing::known_color to_known_color () const
 Gets the xtd::drawing::known_color value of this xtd::drawing::color class. More...
 
xtd::ustring to_string () const noexcept override
 Creates a human-readable string that represents this color class. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 

Static Public Member Functions

static color average (const color &color1, const color &color2, double weight)
 Returns the weighted average color between the two given colors. More...
 
static color average (const color &color1, const color &color2, double weight, bool average_alpha)
 Returns the weighted average color between the two given colors. More...
 
static color dark (const color &color)
 Returns a darker version of the specified color. More...
 
static color dark (const color &color, double weight)
 Returns a darker version of the specified color. More...
 
static xtd::drawing::color from_argb (uint32_t argb)
 Creates a xtd::drawing::color class from a 32-bit ARGB value. More...
 
static xtd::drawing::color from_argb (uint8_t alpha, const xtd::drawing::color &baseColor)
 Creates a xtd::drawing::color class from the specified xtd::drawing::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. More...
 
static xtd::drawing::color from_argb (uint8_t alpha, uint8_t red, uint8_t green, uint8_t blue)
 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. More...
 
static xtd::drawing::color from_argb (uint8_t red, uint8_t green, uint8_t blue)
 Creates a xtd::drawing::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. More...
 
static xtd::drawing::color from_handle (intptr_t handle)
 Creates a xtd::drawing::color class from native handle. More...
 
static xtd::drawing::color from_hsb (float hue, float saturation, float brightness)
 Creates a xtd::drawing::color class from the three HSV component (hue, saturation, and brightness) values. More...
 
static xtd::drawing::color from_hsl (float hue, float saturation, float lightness)
 Creates a xtd::drawing::color class from the three HSL component (hue, saturation, and lightness) values. More...
 
static xtd::drawing::color from_known_color (xtd::drawing::known_color color)
 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. More...
 
static xtd::drawing::color from_name (const xtd::ustring &name)
 Creates a xtd::drawing::color class from the specified name of a predefined color. More...
 
static color light (const color &color)
 Returns a lighter version of the specified color. More...
 
static color light (const color &color, double weight)
 Returns a lighter version of the specified color. More...
 
static xtd::drawing::color parse (const xtd::ustring &color)
 Creates a xtd::drawing::color class from the specified name. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Constructor & Destructor Documentation

◆ color()

xtd::drawing::color::color ( )
default

Initialize a new instance of xtd::drawing::color class.

Member Function Documentation

◆ a()

uint8_t xtd::drawing::color::a ( ) const
inline

Gets the alpha component value of this xtd::drawing::color class.

Returns
byte The alpha component value of this xtd::drawing::color.
Remarks
The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). The alpha component specifies the transparency of the color: 0 is fully transparent, and 255 is fully opaque. Likewise, an A value of 255 represents an opaque color. An A value from 1 through 254 represents a semitransparent color. The color becomes more opaque as A approaches 255.
Examples
The following code example demonstrates the A, R, G, and B properties of a xtd::drawing::color, and the Implicit(size to size_f) member.
This example is designed to be used with a Windows Form (xtd::forms). Paste the code into the form and call the show_properties_of_slate_blue method from the form's paint event-handling method, passing e as paint_event_args.
void show_properties_of_slate_blue(xtd::forms::paint_event_args& e) {
byte g = slate_blue.g();
byte b = slate_blue.b();
byte r = slate_blue.r();
byte a = slate_blue.a();
string text = xtd::string::ustring::format("Slate blue has these ARGB values: alpha:{0}, red:{1}, green: {2}, blue {3}", a, r, g, b);
}

◆ average() [1/2]

static color xtd::drawing::color::average ( const color color1,
const color color2,
double  weight 
)
inlinestatic

Returns the weighted average color between the two given colors.

Parameters
color1The first color.
color2The second color.
weightThe weighting factor
Returns
The average color.
Remarks
The alpha of color1 is conserved.
The red, green and blue values are averages using the following formula:
color = color1 * (1 - weight) + color2 * weight;
Thus, a weight value of 1.0 will return the second color, while a value of 0.0 will return the first color.

◆ average() [2/2]

static color xtd::drawing::color::average ( const color color1,
const color color2,
double  weight,
bool  average_alpha 
)
inlinestatic

Returns the weighted average color between the two given colors.

Parameters
color1The first color.
color2The second color.
weightThe weighting factor
average_alphaif true alpha was compute to; otherwise the alpha result is the alpha of color1
Returns
The average color.
Remarks
The alpha, red, green and blue values are averages using the following formula:
color = color1 * (1 - weight) + color2 * weight;
Thus, a weight value of 1.0 will return the first color, while a value of 0.0 will return the second color.

◆ b()

uint8_t xtd::drawing::color::b ( ) const
inline

Gets the blue component value of this xtd::drawing::color class.

Returns
byte The blue component value of this xtd::drawing::color.
Remarks
The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). The alpha component specifies the transparency of the color: 0 is fully transparent, and 255 is fully opaque. Likewise, an A value of 255 represents an opaque color. An A value from 1 through 254 represents a semitransparent color. The color becomes more opaque as A approaches 255.
Examples
The following code example demonstrates the A, R, G, and B properties of a xtd::drawing::color, and the Implicit(size to size_f) member.
This example is designed to be used with a Windows Form (xtd::forms). Paste the code into the form and call the show_properties_of_slate_blue method from the form's paint event-handling method, passing e as paint_event_args.
void show_properties_of_slate_blue(xtd::forms::paint_event_args& e) {
byte g = slate_blue.g();
byte b = slate_blue.b();
byte r = slate_blue.r();
byte a = slate_blue.a();
string text = xtd::ustring::format("Slate blue has these ARGB values: alpha:{0}, red:{1}, green: {2}, blue {3}", a, r, g, b);
}

◆ dark() [1/2]

static color xtd::drawing::color::dark ( const color color)
inlinestatic

Returns a darker version of the specified color.

Parameters
colorThe color to dark.
Returns
the darker color result.

◆ dark() [2/2]

static color xtd::drawing::color::dark ( const color color,
double  weight 
)
inlinestatic

Returns a darker version of the specified color.

Parameters
colorThe color to dark.
Returns
the darker color result.

◆ from_argb() [1/4]

static xtd::drawing::color xtd::drawing::color::from_argb ( uint32_t  argb)
static

Creates a xtd::drawing::color class from a 32-bit ARGB value.

Parameters
argbA value specifying the 32-bit ARGB value
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.
Remarks
The byte-ordering of the 32-bit ARGB value is AARRGGBB. The most significant byte (MSB), represented by AA, is the alpha component value. The second, third, and fourth bytes, represented by RR, GG, and BB, respectively, are the color components red, green, and blue, respectively.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates three brushes, each a different color. Each Color structure that is used to create a brush is created from four component values (alpha, red, green, blue).
  • Uses an imaginary triangle to position three circles.
  • Paints three overlapping circles, each centered on one vertex of the triangle, using a different brush for each circle.
    void from_argb1(paint_event_args& e) {
    graphics g = e.graphics();
    // Transparent red, green, and blue brushes.
    solid_brush trns_red_brush(color::from_argb(0x78FF0000));
    solid_brush trns_green_brush(color::from_argb(0x7800FF00));
    solid_brush trns_blue_brush(color::from_argb(0x780000FF));
    // Base and height of the triangle that is used to position the circles. Each vertex of the triangle is at the center of one of the 3 circles. The base is equal to the diameter of the circles.
    float tri_base = 100;
    float tri_height = std::sqrt(3 * (tri_base * tri_base) / 4);
    // Coordinates of first circle's bounding rectangle.
    float x1 = 40;
    float y1 = 40;
    // Fill 3 over-lapping circles. Each circle is a different color.
    g.fill_ellipse(trns_red_brush, x1, y1, 2 * tri_height, 2 * tri_height);
    g.fill_ellipse(trns_green_brush, x1 + tri_base / 2, y1 + tri_height, 2 * tri_height, 2 * tri_height);
    g.fill_ellipse(trns_blue_brush, x1 + tri_base, y1, 2 * tri_height, 2 * tri_height);
    }
    static xtd::drawing::color from_argb(uint32_t argb)
    Creates a xtd::drawing::color class from a 32-bit ARGB value.

◆ from_argb() [2/4]

static xtd::drawing::color xtd::drawing::color::from_argb ( uint8_t  alpha,
const xtd::drawing::color baseColor 
)
static

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

Parameters
alphaThe alpha value for the new xtd::drawing::color. Valid values are 0 through 255.
baseColorThe xtd::drawing::color from which to create the new xtd::drawing::color.
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates Color structures from the three color component values (red, green, blue). Three Color structures are created, one for each primary color.
  • Iterates through a range of alpha values, changing the alpha value of a color.
  • During each iteration, sets the color of a brush to the modified color and paints a rectangle to show the color.
  • Repeats steps 2 and 3 for each primary color. The alpha value is never fully opaque and the rectangles overlap so you get color-combination effects.
    void from_argb2(paint_event_aArgs& e) {
    graphics g = e.graphics();
    // Opaque colors (alpha value defaults to 255 -- max value).
    color red = color::from_argb(255, 0, 0);
    color blue = color::from_argb(0, 0, 255);
    // Solid brush initialized to red.
    solid_brush my_brush(red);
    int alpha;
    // x coordinate of first red rectangle
    int x = 50;
    // y coordinate of first red rectangle
    int y = 50;
    // Fill rectangles with red, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25) {
    my_brush.color(color::from_argb(alpha, red));
    g.fill_rectangle(my_brush, x, y, 50, 100);
    g.fill_rectangle(my_brush, x, y + 250, 50, 50);
    x += 50;
    }
    // x coordinate of first green rectangle.
    x = 50;
    // y coordinate of first green rectangle.
    y += 50;
    // Fill rectangles with green, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25) {
    my_brush.color(color::from_argb(alpha, green));
    g.fill_rectangle(my_brush, x, y, 50, 150);
    x += 50;
    }
    // x coordinate of first blue rectangle.
    x = 50;
    // y coordinate of first blue rectangle.
    y += 100;
    // Fill rectangles with blue, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25) {
    my_brush.color(color::from_argb(alpha, blue));
    g.fill_rectangle(my_brush, x, y, 50, 150);
    x += 50;
    }
    }
    static const xtd::drawing::color green
    Gets a system-defined color that has an ARGB value of 0xFF008000. This field is constant.
    Definition: color.h:201
    static const xtd::drawing::color red
    Gets a system-defined color that has an ARGB value of 0xFFFF0000. This field is constant.
    Definition: color.h:390
    static const xtd::drawing::color blue
    Gets a system-defined color that has an ARGB value of 0xFF0000FF. This field is constant.
    Definition: color.h:75
    @ y
    The Y key.
    @ x
    The X key.
    @ alpha
    The pixel data contains alpha values that are not premultiplied.

◆ from_argb() [3/4]

static xtd::drawing::color xtd::drawing::color::from_argb ( uint8_t  alpha,
uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
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.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates three brushes, each a different color. Each Color structure that is used to create a brush is created from four component values (alpha, red, green, blue).
  • Uses an imaginary triangle to position three circles.
  • Paints three overlapping circles, each centered on one vertex of the triangle, using a different brush for each circle.
    void from_argb1(paint_event_args& e) {
    graphics g = e.graphics();
    // Transparent red, green, and blue brushes.
    solid_brush trns_red_brush(color::from_argb(120, 255, 0, 0));
    solid_brush trns_green_brush(color::from_argb(120, 0, 255, 0));
    solid_brush trns_blue_brush(color::from_argb(120, 0, 0, 255));
    // Base and height of the triangle that is used to position the circles. Each vertex of the triangle is at the center of one of the 3 circles. The base is equal to the diameter of the circles.
    float tri_base = 100;
    float tri_height = std::sqrt(3 * (tri_base * tri_base) / 4);
    // Coordinates of first circle's bounding rectangle.
    float x1 = 40;
    float y1 = 40;
    // Fill 3 over-lapping circles. Each circle is a different color.
    g.fill_ellipse(trns_red_brush, x1, y1, 2 * tri_height, 2 * tri_height);
    g.fill_ellipse(trns_green_brush, x1 + tri_base / 2, y1 + tri_height, 2 * tri_height, 2 * tri_height);
    g.fill_ellipse(trns_blue_brush, x1 + tri_base, y1, 2 * tri_height, 2 * tri_height);
    }

◆ from_argb() [4/4]

static xtd::drawing::color xtd::drawing::color::from_argb ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
static

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

Parameters
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.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates Color structures from the three color component values (red, green, blue). Three Color structures are created, one for each primary color.
  • Iterates through a range of alpha values, changing the alpha value of a color.
  • During each iteration, sets the color of a brush to the modified color and paints a rectangle to show the color.
  • Repeats steps 2 and 3 for each primary color. The alpha value is never fully opaque and the rectangles overlap so you get color-combination effects.
    void from_argb2(paint_event_aArgs& e) {
    graphics g = e.graphics();
    // Opaque colors (alpha value defaults to 255 -- max value).
    color red = color::from_argb(255, 0, 0);
    color blue = color::from_argb(0, 0, 255);
    // Solid brush initialized to red.
    solid_brush my_brush(red);
    int alpha;
    // x coordinate of first red rectangle
    int x = 50;
    // y coordinate of first red rectangle
    int y = 50;
    // Fill rectangles with red, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25) {
    my_brush.color(color::from_argb(alpha, red));
    g.fill_rectangle(my_brush, x, y, 50, 100);
    g.fill_rectangle(my_brush, x, y + 250, 50, 50);
    x += 50;
    }
    // x coordinate of first green rectangle.
    x = 50;
    // y coordinate of first green rectangle.
    y += 50;
    // Fill rectangles with green, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25) {
    my_brush.color(color::from_argb(alpha, green));
    g.fill_rectangle(my_brush, x, y, 50, 150);
    x += 50;
    }
    // x coordinate of first blue rectangle.
    x = 50;
    // y coordinate of first blue rectangle.
    y += 100;
    // Fill rectangles with blue, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25) {
    my_brush.color(color::from_argb(alpha, blue));
    g.fill_rectangle(my_brush, x, y, 50, 150);
    x += 50;
    }
    }

◆ from_handle()

static xtd::drawing::color xtd::drawing::color::from_handle ( intptr_t  handle)
static

Creates a xtd::drawing::color class from native handle.

Parameters
handlethe handle for the new xtd::drawing::color.
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.
Remarks
For internal use only.

◆ from_hsb()

static xtd::drawing::color xtd::drawing::color::from_hsb ( float  hue,
float  saturation,
float  brightness 
)
static

Creates a xtd::drawing::color class from the three HSV component (hue, saturation, and brightness) values.

Parameters
hueThe xtd::drawing::color saturation. The saturation ranges from 0.0 through 1.0, where 0.0 is grayscale and 1.0 is the most saturated.
saturationThe xtd::drawing::color saturation. The saturation ranges from 0.0 through 1.0, where 0.0 is grayscale and 1.0 is the most saturated.
brightnessThe xtd::drawing::color lightness. The brightness ranges from 0.0 through 1.0, where 0.0 represents black and 1.0 represents white.

◆ from_hsl()

static xtd::drawing::color xtd::drawing::color::from_hsl ( float  hue,
float  saturation,
float  lightness 
)
static

Creates a xtd::drawing::color class from the three HSL component (hue, saturation, and lightness) values.

Parameters
hueThe xtd::drawing::color saturation. The saturation ranges from 0.0 through 1.0, where 0.0 is grayscale and 1.0 is the most saturated.
saturationThe xtd::drawing::color saturation. The saturation ranges from 0.0 through 1.0, where 0.0 is grayscale and 1.0 is the most saturated.
lightnessThe xtd::drawing::color lightness. The lightness ranges from 0.0 through 1.0, where 0.0 represents black and 1.0 represents white.

◆ 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 PaintEventArgs, which is a parameter of the Paint event handler. The code performs the following actions:

◆ from_name()

static xtd::drawing::color xtd::drawing::color::from_name ( const xtd::ustring name)
static

Creates a xtd::drawing::color class from the specified name of a predefined color.

Parameters
nameA string that is the name of a predefined color. Valid names are the same as the names of the elements of the xtd::drawing::known_color enumeration.
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.
Remarks
A predefined color is also called a known color and is represented by an element of the xtd::drawing::known_color enumeration. If the name parameter is not the valid name of a predefined color, the FromName method creates a xtd::drawing::color structure that has an ARGB value of 0 (that is, all ARGB components are 0).
Examples
The following code example demonstrates the A, R, G, and B properties of a xtd::drawing::color, and the Implicit(size to size_f) member.
This example is designed to be used with a Windows Form (xtd::forms). Paste the code into the form and call the show_properties_of_slate_blue method from the form's paint event-handling method, passing e as paint_event_args.
void show_properties_of_slate_blue(xtd::forms::paint_event_args& e) {
byte g = slate_blue.g();
byte b = slate_blue.b();
byte r = slate_blue.r();
byte a = slate_blue.a();
string text = xtd::ustring::format("Slate blue has these ARGB values: alpha:{0}, red:{1}, green: {2}, blue {3}", a, r, g, b);
}

◆ g()

uint8_t xtd::drawing::color::g ( ) const
inline

Gets the green component value of this xtd::drawing::color class.

Returns
byte The green component value of this xtd::drawing::color.
Remarks
The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). The alpha component specifies the transparency of the color: 0 is fully transparent, and 255 is fully opaque. Likewise, an A value of 255 represents an opaque color. An A value from 1 through 254 represents a semitransparent color. The color becomes more opaque as A approaches 255.
Examples
The following code example demonstrates the A, R, G, and B properties of a xtd::drawing::color, and the Implicit(size to size_f) member.
This example is designed to be used with a Windows Form (xtd::forms). Paste the code into the form and call the show_properties_of_slate_blue method from the form's paint event-handling method, passing e as paint_event_args.
void show_properties_of_slate_blue(xtd::forms::paint_event_args& e) {
byte g = slate_blue.g();
byte b = slate_blue.b();
byte r = slate_blue.r();
byte a = slate_blue.a();
string text = xtd::ustring::format("Slate blue has these ARGB values: alpha:{0}, red:{1}, green: {2}, blue {3}", a, r, g, b);
}

◆ get_brightness()

float xtd::drawing::color::get_brightness ( ) const

Gets the hue-saturation-brightness (HSB) brightness value for this xtd::drawing::color structure.

Returns
The brightness of this xtd::drawing::color. The lightness ranges from 0.0 through 1.0, where 0.0 represents black and 1.0 represents white.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates an instance of a xtd::drawing::color structure, redShade, to be used for comparisons.
  • Iterates through the xtd::drawing::known_color enumeration elements to find all known colors that have the same lightness as redShade. The iterations are terminated when 15 matches are found or the value of the loop counter is greater than the last xtd::drawing::known_color element.
  • During each iteration, saves the xtd::drawing::known_color element—if it matches the criteria—in an array.
  • Uses a brush to paint rectangles. The first rectangle is painted the color represented by redShade. Each of the other rectangles is painted a xtd::drawing::known_color that matches the hue of the redShade.
    void known_color_brightness_example2(paint_event_args& e) {
    graphics g = e.graphics();
    // xtd::drawing::color structures. One is a variable used for temporary storage. The other is a constant used for comparisons.
    xtd::drawing::color red_shade = xtd::drawing::color::from_argb(255, 200, 0, 100);
    // Array to store xtd::drawing::known_color values that match the hue of the redShade color.
    std::vector<xtd::drawing::known_color> color_matches(15);
    // Number of matches found.
    int count = 0;
    // Iterate through the xtd::drawing::known_color enums until 15 matches are found.
    for (xtd::drawing::known_color enum_value = 0; enum_value <= xtd::drawing::known_color::yellow_green && count < 15; enum_value = known_color(int(enum_value) + 1)) {
    some_color = xtd::drawing::color::from_known_color(enum_value);
    if (some_color.get_brightness() == red_shade.get_brightness())
    color_matches[count++] = enum_value;
    }
    // Display the redShade color and its argb value.
    solid_brush my_brush1(red_shade);
    font my_font("Arial", 12);
    int x = 20;
    int y = 20;
    some_color = red_shade;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    // Iterate through the matches that were found and display each color that corresponds with the enum value in the array. also display the name of the xtd::drawing::known_color.
    for (int i = 0; i < count; i++) {
    y += 40;
    some_color = xtd::drawing::color::from_known_color(color_matches[i]);
    my_brush1.xtd::drawing::color = some_color;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    }
    }

◆ get_hue()

float xtd::drawing::color::get_hue ( ) const

Gets the hue-saturation-brightness (HSB) hue value, in degrees, for this xtd::drawing::color structure.

Returns
The hue, in degrees, of this xtd::drawing::color. The hue is measured in degrees, ranging from 0.0 through 360.0, in HSL color space.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates an instance of a xtd::drawing::color structure, redShade, to be used for comparisons.
  • Iterates through the xtd::drawing::known_color enumeration elements to find all known colors that have the same lightness as redShade. The iterations are terminated when 15 matches are found or the value of the loop counter is greater than the last xtd::drawing::known_color element.
  • During each iteration, saves the xtd::drawing::known_color element—if it matches the criteria—in an array.
  • Uses a brush to paint rectangles. The first rectangle is painted the color represented by redShade. Each of the other rectangles is painted a xtd::drawing::known_color that matches the hue of the redShade.
    void known_color_brightness_example2(paint_event_args& e) {
    graphics g = e.graphics();
    // xtd::drawing::color structures. One is a variable used for temporary storage. The other is a constant used for comparisons.
    xtd::drawing::color red_shade = xtd::drawing::color::from_argb(255, 200, 0, 100);
    // Array to store xtd::drawing::known_color values that match the hue of the redShade color.
    std::vector<xtd::drawing::known_color> color_matches(15);
    // Number of matches found.
    int count = 0;
    // Iterate through the xtd::drawing::known_color enums until 15 matches are found.
    for (xtd::drawing::known_color enum_value = 0; enum_value <= xtd::drawing::known_color::yellow_green && count < 15; enum_value = known_color(int(enum_value) + 1)) {
    some_color = xtd::drawing::color::from_known_color(enum_value);
    if (some_color.get_brightness() == red_shade.get_brightness())
    color_matches[count++] = enum_value;
    }
    // Display the redShade color and its argb value.
    solid_brush my_brush1(red_shade);
    font my_font("Arial", 12);
    int x = 20;
    int y = 20;
    some_color = red_shade;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    // Iterate through the matches that were found and display each color that corresponds with the enum value in the array. also display the name of the xtd::drawing::known_color.
    for (int i = 0; i < count; i++) {
    y += 40;
    some_color = xtd::drawing::color::from_known_color(color_matches[i]);
    my_brush1.xtd::drawing::color = some_color;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    }
    }

◆ get_lightness()

float xtd::drawing::color::get_lightness ( ) const

Gets the hue-saturation-lightness (HSL) lightness value for this xtd::drawing::color structure.

Returns
The lightness of this xtd::drawing::color. The lightness ranges from 0.0 through 1.0, where 0.0 represents black and 1.0 represents white.

◆ get_saturation()

float xtd::drawing::color::get_saturation ( ) const

Gets the hue-saturation-brightness (HSB) saturation value for this xtd::drawing::color structure.

Returns
The saturation of this xtd::drawing::color. The saturation ranges from 0.0 through 1.0, where 0.0 is grayscale and 1.0 is the most saturated.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates an instance of a xtd::drawing::color structure, redShade, to be used for comparisons.
  • Iterates through the xtd::drawing::known_color enumeration elements to find all known colors that have the same lightness as redShade. The iterations are terminated when 15 matches are found or the value of the loop counter is greater than the last xtd::drawing::known_color element.
  • During each iteration, saves the xtd::drawing::known_color element—if it matches the criteria—in an array.
  • Uses a brush to paint rectangles. The first rectangle is painted the color represented by redShade. Each of the other rectangles is painted a xtd::drawing::known_color that matches the hue of the redShade.
    void known_color_brightness_example2(paint_event_args& e) {
    graphics g = e.graphics();
    // xtd::drawing::color structures. One is a variable used for temporary storage. The other is a constant used for comparisons.
    xtd::drawing::color red_shade = xtd::drawing::color::from_argb(255, 200, 0, 100);
    // Array to store xtd::drawing::known_color values that match the hue of the redShade color.
    std::vector<xtd::drawing::known_color> color_matches(15);
    // Number of matches found.
    int count = 0;
    // Iterate through the xtd::drawing::known_color enums until 15 matches are found.
    for (xtd::drawing::known_color enum_value = 0; enum_value <= xtd::drawing::known_color::yellow_green && count < 15; enum_value = known_color(int(enum_value) + 1)) {
    some_color = xtd::drawing::color::from_known_color(enum_value);
    if (some_color.get_brightness() == red_shade.get_brightness())
    color_matches[count++] = enum_value;
    }
    // Display the redShade color and its argb value.
    solid_brush my_brush1(red_shade);
    font my_font("Arial", 12);
    int x = 20;
    int y = 20;
    some_color = red_shade;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    // Iterate through the matches that were found and display each color that corresponds with the enum value in the array. also display the name of the xtd::drawing::known_color.
    for (int i = 0; i < count; i++) {
    y += 40;
    some_color = xtd::drawing::color::from_known_color(color_matches[i]);
    my_brush1.xtd::drawing::color = some_color;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    }
    }

◆ handle()

intptr_t xtd::drawing::color::handle ( ) const
inline

Gets the native handle of this xtd::drawing::color class.

Remarks
For internal use only, needed for system_colors.

◆ is_empty()

bool xtd::drawing::color::is_empty ( ) const
inline

Specifies whether this xtd::drawing::color class is uninitialized.

Returns
bool Returns true if this color is uninitialized; otherwise, false.

◆ is_known_color()

bool xtd::drawing::color::is_known_color ( ) const
inline

Gets a value indicating whether this xtd::drawing::color structure is a predefined color. Predefined colors are represented by the elements of the xtd::drawing::known_color enumeration.

Returns
bool Returns true if this xtd::drawing::color was created from a predefined color by using either the from_name method or the from_known_color method; otherwise, false.
Remarks
This property does not do a comparison of the ARGB values. Therefore, when the is_known_color property is applied to a xtd::drawing::color structure that is created by using the from_argb method, is_known_color returns false, even if the ARGB value matches the ARGB value of a predefined color.

◆ is_named_color()

bool xtd::drawing::color::is_named_color ( ) const
inline

Gets a value indicating whether this xtd::drawing::color structure is a named color or a member of the xtd::drawing::known_color enumeration.

Returns
bool Returns true if this xtd::drawing::color was created by using either the FromName method or the FromKnownColor method; otherwise, false.

◆ is_system_color()

bool xtd::drawing::color::is_system_color ( ) const

Gets a value indicating whether this xtd::drawing::color structure is a system color. A system color is a color that is used in a Windows display element. System colors are represented by elements of the xtd::drawing::known_color enumeration.

Returns
bool Returns true if this xtd::drawing::color was created from a system color by using either the FromName method or the FromKnownColor method; otherwise, false.

◆ light() [1/2]

static color xtd::drawing::color::light ( const color color)
inlinestatic

Returns a lighter version of the specified color.

Parameters
colorThe color to light.
Returns
the lighter color result.

◆ light() [2/2]

static color xtd::drawing::color::light ( const color color,
double  weight 
)
inlinestatic

Returns a lighter version of the specified color.

Parameters
colorThe color to light.
Returns
the lighter color result.

◆ name()

xtd::ustring xtd::drawing::color::name ( ) const
inline

Gets the name of this xtd::drawing::color.

Returns
string The name of this xtd::drawing::color.

◆ parse()

static xtd::drawing::color xtd::drawing::color::parse ( const xtd::ustring color)
static

Creates a xtd::drawing::color class from the specified name.

Parameters
nameA string that is the name of a predefined color. Valid names are the same as the names of the elements of the xtd::drawing::known_color enumeration or hexadecimal value that represents argb value, or four decimal values separated by a comma representing respectively a, r, g, b, values.
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.

◆ r()

uint8_t xtd::drawing::color::r ( ) const
inline

Gets the red component value of this xtd::drawing::color class.

Returns
byte The red component value of this xtd::drawing::color.
Remarks
The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). The alpha component specifies the transparency of the color: 0 is fully transparent, and 255 is fully opaque. Likewise, an A value of 255 represents an opaque color. An A value from 1 through 254 represents a semitransparent color. The color becomes more opaque as A approaches 255.
Examples
The following code example demonstrates the A, R, G, and B properties of a xtd::drawing::color, and the Implicit(size to size_f) member.
This example is designed to be used with a Windows Form (xtd::forms). Paste the code into the form and call the show_properties_of_slate_blue method from the form's paint event-handling method, passing e as paint_event_args.
void show_properties_of_slate_blue(xtd::forms::paint_event_args& e) {
byte g = slate_blue.g();
byte b = slate_blue.b();
byte r = slate_blue.r();
byte a = slate_blue.a();
string text = xtd::ustring::format("Slate blue has these ARGB values: alpha:{0}, red:{1}, green: {2}, blue {3}", a, r, g, b);
}

◆ to_argb()

uint32_t xtd::drawing::color::to_argb ( ) const

Gets the 32-bit ARGB value of this xtd::drawing::color class.

Returns
int The 32-bit ARGB value of this xtd::drawing::color.
Remarks
The byte-ordering of the 32-bit ARGB value is AARRGGBB. The most significant byte (MSB), represented by AA, is the alpha component value. The second, third, and fourth bytes, represented by RR, GG, and BB, respectively, are the color components red, green, and blue, respectively.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates an instance of a xtd::drawing::color structure, redShade, to be used for comparisons.
  • Iterates through the xtd::drawing::known_color enumeration elements to find all known colors that have the same lightness as redShade. The iterations are terminated when 15 matches are found or the value of the loop counter is greater than the last xtd::drawing::known_color element.
  • During each iteration, saves the xtd::drawing::known_color element—if it matches the criteria—in an array.
  • Uses a brush to paint rectangles. The first rectangle is painted the color represented by redShade. Each of the other rectangles is painted a xtd::drawing::known_color that matches the hue of the redShade.
    void known_color_brightness_example2(paint_event_args& e) {
    graphics g = e.graphics();
    // xtd::drawing::color structures. One is a variable used for temporary storage. The other is a constant used for comparisons.
    xtd::drawing::color red_shade = xtd::drawing::color::from_argb(255, 200, 0, 100);
    // Array to store xtd::drawing::known_color values that match the hue of the redShade color.
    std::vector<xtd::drawing::known_color> color_matches(15);
    // Number of matches found.
    int count = 0;
    // Iterate through the xtd::drawing::known_color enums until 15 matches are found.
    for (xtd::drawing::known_color enum_value = 0; enum_value <= xtd::drawing::known_color::yellow_green && count < 15; enum_value = known_color(int(enum_value) + 1)) {
    some_color = xtd::drawing::color::from_known_color(enum_value);
    if (some_color.get_brightness() == red_shade.get_brightness())
    color_matches[count++] = enum_value;
    }
    // Display the redShade color and its argb value.
    solid_brush my_brush1(red_shade);
    font my_font("Arial", 12);
    int x = 20;
    int y = 20;
    some_color = red_shade;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    // Iterate through the matches that were found and display each color that corresponds with the enum value in the array. also display the name of the xtd::drawing::known_color.
    for (int i = 0; i < count; i++) {
    y += 40;
    some_color = xtd::drawing::color::from_known_color(color_matches[i]);
    my_brush1.xtd::drawing::color = some_color;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    }
    }

◆ to_known_color()

xtd::drawing::known_color xtd::drawing::color::to_known_color ( ) const

Gets the xtd::drawing::known_color value of this xtd::drawing::color class.

Returns
xtd::drawing::known_color An element of the xtd::drawing::known_color enumeration, if the xtd::drawing::color is created from a predefined color by using either the FromName method or the FromKnownColor method; otherwise, 0.
Remarks
A predefined color is also called a known color and is represented by an element of the xtd::drawing::known_color enumeration. When the ToKnownColor method is applied to a xtd::drawing::color structure that is created by using the FromArgb method, ToKnownColor returns 0, even if the ARGB value matches the ARGB value of a predefined color. ToKnownColor also returns 0 when it is applied to a xtd::drawing::color structure that is created by using the FromName method with a string name that is not valid.

◆ to_string()

xtd::ustring xtd::drawing::color::to_string ( ) const
overridevirtualnoexcept

Creates a human-readable string that represents this color class.

Returns
string A string that represents this Size.
Examples
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs, which is a parameter of the Paint event handler. The code performs the following actions:
  • Creates an instance of a xtd::drawing::color structure, redShade, to be used for comparisons.
  • Iterates through the xtd::drawing::known_color enumeration elements to find all known colors that have the same lightness as redShade. The iterations are terminated when 15 matches are found or the value of the loop counter is greater than the last xtd::drawing::known_color element.
  • During each iteration, saves the xtd::drawing::known_color element—if it matches the criteria—in an array.
  • Uses a brush to paint rectangles. The first rectangle is painted the color represented by redShade. Each of the other rectangles is painted a xtd::drawing::known_color that matches the hue of the redShade.
    void known_color_brightness_example2(paint_event_args& e) {
    graphics g = e.graphics();
    // xtd::drawing::color structures. One is a variable used for temporary storage. The other is a constant used for comparisons.
    xtd::drawing::color red_shade = xtd::drawing::color::from_argb(255, 200, 0, 100);
    // Array to store xtd::drawing::known_color values that match the hue of the redShade color.
    std::vector<xtd::drawing::known_color> color_matches(15);
    // Number of matches found.
    int count = 0;
    // Iterate through the xtd::drawing::known_color enums until 15 matches are found.
    for (xtd::drawing::known_color enum_value = 0; enum_value <= xtd::drawing::known_color::yellow_green && count < 15; enum_value = known_color(int(enum_value) + 1)) {
    some_color = xtd::drawing::color::from_known_color(enum_value);
    if (some_color.get_brightness() == red_shade.get_brightness())
    color_matches[count++] = enum_value;
    }
    // Display the redShade color and its argb value.
    solid_brush my_brush1(red_shade);
    font my_font("Arial", 12);
    int x = 20;
    int y = 20;
    some_color = red_shade;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    // Iterate through the matches that were found and display each color that corresponds with the enum value in the array. also display the name of the xtd::drawing::known_color.
    for (int i = 0; i < count; i++) {
    y += 40;
    some_color = xtd::drawing::color::from_known_color(color_matches[i]);
    my_brush1.xtd::drawing::color = some_color;
    g.fill_rectangle(my_brush1, x, y, 100, 30);
    g.draw_string(some_color.to_string(), my_font, brushes::black, x + 120, y);
    }
    }

Reimplemented from xtd::object.

Member Data Documentation

◆ alice_blue

const xtd::drawing::color xtd::drawing::color::alice_blue
static

Gets a system-defined color that has an ARGB value of 0xFFF0F8FF. This field is constant.

◆ antique_white

const xtd::drawing::color xtd::drawing::color::antique_white
static

Gets a system-defined color that has an ARGB value of 0xFFFAEBD7. This field is constant.

◆ aqua

const xtd::drawing::color xtd::drawing::color::aqua
static

Gets a system-defined color that has an ARGB value of 0xFF00FFFF. This field is constant.

◆ aquamarine

const xtd::drawing::color xtd::drawing::color::aquamarine
static

Gets a system-defined color that has an ARGB value of 0xFF7FFFD4. This field is constant.

◆ azure

const xtd::drawing::color xtd::drawing::color::azure
static

Gets a system-defined color that has an ARGB value of 0xFFF0FFFF. This field is constant.

◆ beige

const xtd::drawing::color xtd::drawing::color::beige
static

Gets a system-defined color that has an ARGB value of 0xFFF5F5DC. This field is constant.

◆ bisque

const xtd::drawing::color xtd::drawing::color::bisque
static

Gets a system-defined color that has an ARGB value of 0xFFFFE4C4. This field is constant.

◆ black

const xtd::drawing::color xtd::drawing::color::black
static

Gets a system-defined color that has an ARGB value of 0xFF000000. This field is constant.

Examples
debug_form.cpp.

◆ blanched_almond

const xtd::drawing::color xtd::drawing::color::blanched_almond
static

Gets a system-defined color that has an ARGB value of 0xFFFFEBCD. This field is constant.

◆ blue

const xtd::drawing::color xtd::drawing::color::blue
static

Gets a system-defined color that has an ARGB value of 0xFF0000FF. This field is constant.

Examples
fill_rectangle.cpp.

◆ blue_violet

const xtd::drawing::color xtd::drawing::color::blue_violet
static

Gets a system-defined color that has an ARGB value of 0xFF8A2BE2. This field is constant.

◆ brown

const xtd::drawing::color xtd::drawing::color::brown
static

Gets a system-defined color that has an ARGB value of 0xFFA52A2A. This field is constant.

◆ burly_wood

const xtd::drawing::color xtd::drawing::color::burly_wood
static

Gets a system-defined color that has an ARGB value of 0xFFDEB887. This field is constant.

◆ cadet_blue

const xtd::drawing::color xtd::drawing::color::cadet_blue
static

Gets a system-defined color that has an ARGB value of 0xFF5F9EA0. This field is constant.

◆ chartreuse

const xtd::drawing::color xtd::drawing::color::chartreuse
static

Gets a system-defined color that has an ARGB value of 0xFF7FFF00. This field is constant.

◆ chocolate

const xtd::drawing::color xtd::drawing::color::chocolate
static

Gets a system-defined color that has an ARGB value of 0xFFD2691E. This field is constant.

◆ coral

const xtd::drawing::color xtd::drawing::color::coral
static

Gets a system-defined color that has an ARGB value of 0xFFFF7F50. This field is constant.

◆ cornflower_blue

const xtd::drawing::color xtd::drawing::color::cornflower_blue
static

Gets a system-defined color that has an ARGB value of 0xFF6495ED. This field is constant.

◆ cornsilk

const xtd::drawing::color xtd::drawing::color::cornsilk
static

Gets a system-defined color that has an ARGB value of 0xFFFFF8DC. This field is constant.

◆ crimson

const xtd::drawing::color xtd::drawing::color::crimson
static

Gets a system-defined color that has an ARGB value of 0xFFDC143C. This field is constant.

◆ cyan

const xtd::drawing::color xtd::drawing::color::cyan
static

Gets a system-defined color that has an ARGB value of 0xFF00FFFF. This field is constant.

◆ dark_blue

const xtd::drawing::color xtd::drawing::color::dark_blue
static

Gets a system-defined color that has an ARGB value of 0xFF00008B. This field is constant.

◆ dark_cyan

const xtd::drawing::color xtd::drawing::color::dark_cyan
static

Gets a system-defined color that has an ARGB value of 0xFF008B8B. This field is constant.

◆ dark_goldenrod

const xtd::drawing::color xtd::drawing::color::dark_goldenrod
static

Gets a system-defined color that has an ARGB value of 0xFFB8860B. This field is constant.

◆ dark_gray

const xtd::drawing::color xtd::drawing::color::dark_gray
static

Gets a system-defined color that has an ARGB value of 0xFFA9A9A9. This field is constant.

◆ dark_green

const xtd::drawing::color xtd::drawing::color::dark_green
static

Gets a system-defined color that has an ARGB value of 0xFF006400. This field is constant.

◆ dark_khaki

const xtd::drawing::color xtd::drawing::color::dark_khaki
static

Gets a system-defined color that has an ARGB value of 0xFFBDB76B. This field is constant.

◆ dark_magenta

const xtd::drawing::color xtd::drawing::color::dark_magenta
static

Gets a system-defined color that has an ARGB value of 0xFF8B008B. This field is constant.

◆ dark_olive_green

const xtd::drawing::color xtd::drawing::color::dark_olive_green
static

Gets a system-defined color that has an ARGB value of 0xFF556B2F. This field is constant.

◆ dark_orange

const xtd::drawing::color xtd::drawing::color::dark_orange
static

Gets a system-defined color that has an ARGB value of 0xFFFF8C00. This field is constant.

◆ dark_orchid

const xtd::drawing::color xtd::drawing::color::dark_orchid
static

Gets a system-defined color that has an ARGB value of 0xFF9932CC. This field is constant.

◆ dark_red

const xtd::drawing::color xtd::drawing::color::dark_red
static

Gets a system-defined color that has an ARGB value of 0xFF8B0000. This field is constant.

◆ dark_salmon

const xtd::drawing::color xtd::drawing::color::dark_salmon
static

Gets a system-defined color that has an ARGB value of 0xFFE9967A. This field is constant.

◆ dark_sea_green

const xtd::drawing::color xtd::drawing::color::dark_sea_green
static

Gets a system-defined color that has an ARGB value of 0xFF8FBC8B. This field is constant.

◆ dark_slate_blue

const xtd::drawing::color xtd::drawing::color::dark_slate_blue
static

Gets a system-defined color that has an ARGB value of 0xFF483D8B. This field is constant.

◆ dark_slate_gray

const xtd::drawing::color xtd::drawing::color::dark_slate_gray
static

Gets a system-defined color that has an ARGB value of 0xFF2F4F4F. This field is constant.

◆ dark_turquoise

const xtd::drawing::color xtd::drawing::color::dark_turquoise
static

Gets a system-defined color that has an ARGB value of 0xFF00CED1. This field is constant.

◆ dark_violet

const xtd::drawing::color xtd::drawing::color::dark_violet
static

Gets a system-defined color that has an ARGB value of 0xFF9400D3. This field is constant.

◆ deep_pink

const xtd::drawing::color xtd::drawing::color::deep_pink
static

Gets a system-defined color that has an ARGB value of 0xFFFF1493. This field is constant.

◆ deep_sky_blue

const xtd::drawing::color xtd::drawing::color::deep_sky_blue
static

Gets a system-defined color that has an ARGB value of 0xFF00BFFF. This field is constant.

◆ dim_gray

const xtd::drawing::color xtd::drawing::color::dim_gray
static

Gets a system-defined color that has an ARGB value of 0xFF696969. This field is constant.

◆ dodger_blue

const xtd::drawing::color xtd::drawing::color::dodger_blue
static

Gets a system-defined color that has an ARGB value of 0xFF1E90FF. This field is constant.

◆ empty

const xtd::drawing::color xtd::drawing::color::empty
static

Represents a color that is null.

◆ firebrick

const xtd::drawing::color xtd::drawing::color::firebrick
static

Gets a system-defined color that has an ARGB value of 0xFFB22222. This field is constant.

◆ floral_white

const xtd::drawing::color xtd::drawing::color::floral_white
static

Gets a system-defined color that has an ARGB value of 0xFFFFFAF0. This field is constant.

◆ forest_green

const xtd::drawing::color xtd::drawing::color::forest_green
static

Gets a system-defined color that has an ARGB value of 0xFF228B22. This field is constant.

◆ fuchsia

const xtd::drawing::color xtd::drawing::color::fuchsia
static

Gets a system-defined color that has an ARGB value of 0xFFFF00FF. This field is constant.

◆ gainsboro

const xtd::drawing::color xtd::drawing::color::gainsboro
static

Gets a system-defined color that has an ARGB value of 0xFFDCDCDC. This field is constant.

◆ ghost_white

const xtd::drawing::color xtd::drawing::color::ghost_white
static

Gets a system-defined color that has an ARGB value of 0xFFF8F8FF. This field is constant.

◆ gold

const xtd::drawing::color xtd::drawing::color::gold
static

Gets a system-defined color that has an ARGB value of 0xFFFFD700. This field is constant.

◆ goldenrod

const xtd::drawing::color xtd::drawing::color::goldenrod
static

Gets a system-defined color that has an ARGB value of 0xFFDAA520. This field is constant.

◆ gray

const xtd::drawing::color xtd::drawing::color::gray
static

Gets a system-defined color that has an ARGB value of 0xFF808080. This field is constant.

◆ green

const xtd::drawing::color xtd::drawing::color::green
static

Gets a system-defined color that has an ARGB value of 0xFF008000. This field is constant.

Examples
fill_rectangle.cpp, and hello_world_label.cpp.

◆ green_yellow

const xtd::drawing::color xtd::drawing::color::green_yellow
static

Gets a system-defined color that has an ARGB value of 0xFFADFF2F. This field is constant.

◆ honeydew

const xtd::drawing::color xtd::drawing::color::honeydew
static

Gets a system-defined color that has an ARGB value of 0xFFF0FFF0. This field is constant.

◆ hot_pink

const xtd::drawing::color xtd::drawing::color::hot_pink
static

Gets a system-defined color that has an ARGB value of 0xFFFF69B4. This field is constant.

◆ indian_red

const xtd::drawing::color xtd::drawing::color::indian_red
static

Gets a system-defined color that has an ARGB value of 0xFFCD5C5C. This field is constant.

◆ indigo

const xtd::drawing::color xtd::drawing::color::indigo
static

Gets a system-defined color that has an ARGB value of 0xFF4B0082. This field is constant.

◆ ivory

const xtd::drawing::color xtd::drawing::color::ivory
static

Gets a system-defined color that has an ARGB value of 0xFFFFFFF0. This field is constant.

◆ khaki

const xtd::drawing::color xtd::drawing::color::khaki
static

Gets a system-defined color that has an ARGB value of 0xFFF0E68C. This field is constant.

◆ lavender

const xtd::drawing::color xtd::drawing::color::lavender
static

Gets a system-defined color that has an ARGB value of 0xFFE6E6FA. This field is constant.

◆ lavender_blush

const xtd::drawing::color xtd::drawing::color::lavender_blush
static

Gets a system-defined color that has an ARGB value of 0xFFFFF0F5. This field is constant.

◆ lawn_green

const xtd::drawing::color xtd::drawing::color::lawn_green
static

Gets a system-defined color that has an ARGB value of 0xFF7CFC00. This field is constant.

◆ lemon_chiffon

const xtd::drawing::color xtd::drawing::color::lemon_chiffon
static

Gets a system-defined color that has an ARGB value of 0xFFFFFACD. This field is constant.

◆ light_blue

const xtd::drawing::color xtd::drawing::color::light_blue
static

Gets a system-defined color that has an ARGB value of 0xFFADD8E6. This field is constant.

Examples
split_container.cpp, and splitter.cpp.

◆ light_coral

const xtd::drawing::color xtd::drawing::color::light_coral
static

Gets a system-defined color that has an ARGB value of 0xFFF08080. This field is constant.

◆ light_cyan

const xtd::drawing::color xtd::drawing::color::light_cyan
static

Gets a system-defined color that has an ARGB value of 0xFFE0FFFF. This field is constant.

◆ light_goldenrod_yellow

const xtd::drawing::color xtd::drawing::color::light_goldenrod_yellow
static

Gets a system-defined color that has an ARGB value of 0xFFFAFAD2. This field is constant.

◆ light_gray

const xtd::drawing::color xtd::drawing::color::light_gray
static

Gets a system-defined color that has an ARGB value of 0xFFD3D3D3. This field is constant.

◆ light_green

const xtd::drawing::color xtd::drawing::color::light_green
static

Gets a system-defined color that has an ARGB value of 0xFF90EE90. This field is constant.

Examples
split_container.cpp, and splitter.cpp.

◆ light_pink

const xtd::drawing::color xtd::drawing::color::light_pink
static

Gets a system-defined color that has an ARGB value of 0xFFFFB6C1. This field is constant.

Examples
splitter.cpp.

◆ light_salmon

const xtd::drawing::color xtd::drawing::color::light_salmon
static

Gets a system-defined color that has an ARGB value of 0xFFFFA07A. This field is constant.

◆ light_sea_green

const xtd::drawing::color xtd::drawing::color::light_sea_green
static

Gets a system-defined color that has an ARGB value of 0xFF20B2AA. This field is constant.

◆ light_sky_blue

const xtd::drawing::color xtd::drawing::color::light_sky_blue
static

Gets a system-defined color that has an ARGB value of 0xFF87CEFA. This field is constant.

◆ light_slate_gray

const xtd::drawing::color xtd::drawing::color::light_slate_gray
static

Gets a system-defined color that has an ARGB value of 0xFF778899. This field is constant.

◆ light_steel_blue

const xtd::drawing::color xtd::drawing::color::light_steel_blue
static

Gets a system-defined color that has an ARGB value of 0xFFB0C4DE. This field is constant.

◆ light_yellow

const xtd::drawing::color xtd::drawing::color::light_yellow
static

Gets a system-defined color that has an ARGB value of 0xFFFFFFE0. This field is constant.

Examples
split_container.cpp, and splitter.cpp.

◆ lime

const xtd::drawing::color xtd::drawing::color::lime
static

Gets a system-defined color that has an ARGB value of 0xFF00FF00. This field is constant.

Examples
debug_form.cpp.

◆ lime_green

const xtd::drawing::color xtd::drawing::color::lime_green
static

Gets a system-defined color that has an ARGB value of 0xFF32CD32. This field is constant.

◆ linen

const xtd::drawing::color xtd::drawing::color::linen
static

Gets a system-defined color that has an ARGB value of 0xFFFAF0E6. This field is constant.

◆ magenta

const xtd::drawing::color xtd::drawing::color::magenta
static

Gets a system-defined color that has an ARGB value of 0xFFFF00FF. This field is constant.

◆ maroon

const xtd::drawing::color xtd::drawing::color::maroon
static

Gets a system-defined color that has an ARGB value of 0xFF800000. This field is constant.

◆ medium_aquamarine

const xtd::drawing::color xtd::drawing::color::medium_aquamarine
static

Gets a system-defined color that has an ARGB value of 0xFF66CDAA. This field is constant.

◆ medium_blue

const xtd::drawing::color xtd::drawing::color::medium_blue
static

Gets a system-defined color that has an ARGB value of 0xFF0000CD. This field is constant.

◆ medium_orchid

const xtd::drawing::color xtd::drawing::color::medium_orchid
static

Gets a system-defined color that has an ARGB value of 0xFFBA55D3. This field is constant.

◆ medium_purple

const xtd::drawing::color xtd::drawing::color::medium_purple
static

Gets a system-defined color that has an ARGB value of 0xFF9370DB. This field is constant.

◆ medium_sea_green

const xtd::drawing::color xtd::drawing::color::medium_sea_green
static

Gets a system-defined color that has an ARGB value of 0xFF3CB371. This field is constant.

◆ medium_slate_blue

const xtd::drawing::color xtd::drawing::color::medium_slate_blue
static

Gets a system-defined color that has an ARGB value of 0xFF7B68EE. This field is constant.

◆ medium_spring_green

const xtd::drawing::color xtd::drawing::color::medium_spring_green
static

Gets a system-defined color that has an ARGB value of 0xFF00FA9A. This field is constant.

◆ medium_turquoise

const xtd::drawing::color xtd::drawing::color::medium_turquoise
static

Gets a system-defined color that has an ARGB value of 0xFF48D1CC. This field is constant.

◆ medium_violet_red

const xtd::drawing::color xtd::drawing::color::medium_violet_red
static

Gets a system-defined color that has an ARGB value of 0xFFC71585. This field is constant.

◆ midnight_blue

const xtd::drawing::color xtd::drawing::color::midnight_blue
static

Gets a system-defined color that has an ARGB value of 0xFF191970. This field is constant.

◆ mint_cream

const xtd::drawing::color xtd::drawing::color::mint_cream
static

Gets a system-defined color that has an ARGB value of 0xFFF5FFFA. This field is constant.

◆ misty_rose

const xtd::drawing::color xtd::drawing::color::misty_rose
static

Gets a system-defined color that has an ARGB value of 0xFFFFE4E1. This field is constant.

◆ moccasin

const xtd::drawing::color xtd::drawing::color::moccasin
static

Gets a system-defined color that has an ARGB value of 0xFFFFE4B5. This field is constant.

◆ navajo_white

const xtd::drawing::color xtd::drawing::color::navajo_white
static

Gets a system-defined color that has an ARGB value of 0xFFFFDEAD. This field is constant.

◆ navy

const xtd::drawing::color xtd::drawing::color::navy
static

Gets a system-defined color that has an ARGB value of 0xFF000080. This field is constant.

◆ old_lace

const xtd::drawing::color xtd::drawing::color::old_lace
static

Gets a system-defined color that has an ARGB value of 0xFFFDF5E6. This field is constant.

◆ olive

const xtd::drawing::color xtd::drawing::color::olive
static

Gets a system-defined color that has an ARGB value of 0xFF808000. This field is constant.

◆ olive_drab

const xtd::drawing::color xtd::drawing::color::olive_drab
static

Gets a system-defined color that has an ARGB value of 0xFF6B8E23. This field is constant.

◆ orange

const xtd::drawing::color xtd::drawing::color::orange
static

Gets a system-defined color that has an ARGB value of 0xFFFFA500. This field is constant.

◆ orange_red

const xtd::drawing::color xtd::drawing::color::orange_red
static

Gets a system-defined color that has an ARGB value of 0xFFFF4500. This field is constant.

◆ orchid

const xtd::drawing::color xtd::drawing::color::orchid
static

Gets a system-defined color that has an ARGB value of 0xFFDA70D6. This field is constant.

◆ pale_goldenrod

const xtd::drawing::color xtd::drawing::color::pale_goldenrod
static

Gets a system-defined color that has an ARGB value of 0xFFEEE8AA. This field is constant.

◆ pale_green

const xtd::drawing::color xtd::drawing::color::pale_green
static

Gets a system-defined color that has an ARGB value of 0xFF98FB98. This field is constant.

◆ pale_turquoise

const xtd::drawing::color xtd::drawing::color::pale_turquoise
static

Gets a system-defined color that has an ARGB value of 0xFFAFEEEE. This field is constant.

◆ pale_violet_red

const xtd::drawing::color xtd::drawing::color::pale_violet_red
static

Gets a system-defined color that has an ARGB value of 0xFFDB7093. This field is constant.

◆ papaya_whip

const xtd::drawing::color xtd::drawing::color::papaya_whip
static

Gets a system-defined color that has an ARGB value of 0xFFFFEFD5. This field is constant.

◆ peach_puff

const xtd::drawing::color xtd::drawing::color::peach_puff
static

Gets a system-defined color that has an ARGB value of 0xFFFFDAB9. This field is constant.

◆ peru

const xtd::drawing::color xtd::drawing::color::peru
static

Gets a system-defined color that has an ARGB value of 0xFFCD853F. This field is constant.

◆ pink

const xtd::drawing::color xtd::drawing::color::pink
static

Gets a system-defined color that has an ARGB value of 0xFFFFC0CB. This field is constant.

Examples
split_container.cpp.

◆ plum

const xtd::drawing::color xtd::drawing::color::plum
static

Gets a system-defined color that has an ARGB value of 0xFFDDA0DD. This field is constant.

◆ powder_blue

const xtd::drawing::color xtd::drawing::color::powder_blue
static

Gets a system-defined color that has an ARGB value of 0xFFB0E0E6. This field is constant.

◆ purple

const xtd::drawing::color xtd::drawing::color::purple
static

Gets a system-defined color that has an ARGB value of 0xFF800080. This field is constant.

◆ rebecca_purple

const xtd::drawing::color xtd::drawing::color::rebecca_purple
static

Gets a system-defined color that has an ARGB value of 0xFF663399. This field is constant.

◆ red

const xtd::drawing::color xtd::drawing::color::red
static

Gets a system-defined color that has an ARGB value of 0xFFFF0000. This field is constant.

Examples
busy_dialog.cpp, color_picker.cpp, and fill_rectangle.cpp.

◆ rosy_brown

const xtd::drawing::color xtd::drawing::color::rosy_brown
static

Gets a system-defined color that has an ARGB value of 0xFFBC8F8F. This field is constant.

◆ royal_blue

const xtd::drawing::color xtd::drawing::color::royal_blue
static

Gets a system-defined color that has an ARGB value of 0xFF4169E1. This field is constant.

◆ saddle_brown

const xtd::drawing::color xtd::drawing::color::saddle_brown
static

Gets a system-defined color that has an ARGB value of 0xFF8B4513. This field is constant.

◆ salmon

const xtd::drawing::color xtd::drawing::color::salmon
static

Gets a system-defined color that has an ARGB value of 0xFFFA8072. This field is constant.

◆ sandy_brown

const xtd::drawing::color xtd::drawing::color::sandy_brown
static

Gets a system-defined color that has an ARGB value of 0xFFF4A460. This field is constant.

◆ sea_green

const xtd::drawing::color xtd::drawing::color::sea_green
static

Gets a system-defined color that has an ARGB value of 0xFF2E8B57. This field is constant.

◆ sea_shell

const xtd::drawing::color xtd::drawing::color::sea_shell
static

Gets a system-defined color that has an ARGB value of 0xFFFFF5EE. This field is constant.

◆ sienna

const xtd::drawing::color xtd::drawing::color::sienna
static

Gets a system-defined color that has an ARGB value of 0xFFA0522D. This field is constant.

◆ silver

const xtd::drawing::color xtd::drawing::color::silver
static

Gets a system-defined color that has an ARGB value of 0xFFC0C0C0. This field is constant.

◆ sky_blue

const xtd::drawing::color xtd::drawing::color::sky_blue
static

Gets a system-defined color that has an ARGB value of 0xFF87CEEB. This field is constant.

◆ slate_blue

const xtd::drawing::color xtd::drawing::color::slate_blue
static

Gets a system-defined color that has an ARGB value of 0xFF6A5ACD. This field is constant.

◆ slate_gray

const xtd::drawing::color xtd::drawing::color::slate_gray
static

Gets a system-defined color that has an ARGB value of 0xFF708090. This field is constant.

◆ snow

const xtd::drawing::color xtd::drawing::color::snow
static

Gets a system-defined color that has an ARGB value of 0xFFFFFAFA. This field is constant.

◆ spring_green

const xtd::drawing::color xtd::drawing::color::spring_green
static

Gets a system-defined color that has an ARGB value of 0xFF00FF7F. This field is constant.

◆ steel_blue

const xtd::drawing::color xtd::drawing::color::steel_blue
static

Gets a system-defined color that has an ARGB value of 0xFF4682B4. This field is constant.

◆ tan

const xtd::drawing::color xtd::drawing::color::tan
static

Gets a system-defined color that has an ARGB value of 0xFFD2B48C. This field is constant.

◆ teal

const xtd::drawing::color xtd::drawing::color::teal
static

Gets a system-defined color that has an ARGB value of 0xFF008080. This field is constant.

◆ thistle

const xtd::drawing::color xtd::drawing::color::thistle
static

Gets a system-defined color that has an ARGB value of 0xFFD8BFD8. This field is constant.

◆ tomato

const xtd::drawing::color xtd::drawing::color::tomato
static

Gets a system-defined color that has an ARGB value of 0xFFFF6347. This field is constant.

◆ transparent

const xtd::drawing::color xtd::drawing::color::transparent
static

Gets a system-defined color that has an ARGB value of 0x00FFFFFF. This field is constant.

◆ turquoise

const xtd::drawing::color xtd::drawing::color::turquoise
static

Gets a system-defined color that has an ARGB value of 0xFF40E0D0. This field is constant.

◆ violet

const xtd::drawing::color xtd::drawing::color::violet
static

Gets a system-defined color that has an ARGB value of 0xFFEE82EE. This field is constant.

◆ wheat

const xtd::drawing::color xtd::drawing::color::wheat
static

Gets a system-defined color that has an ARGB value of 0xFFF5DEB3. This field is constant.

◆ white

const xtd::drawing::color xtd::drawing::color::white
static

Gets a system-defined color that has an ARGB value of 0xFFFFFFFF. This field is constant.

Examples
busy_dialog.cpp, and fill_rectangle.cpp.

◆ white_smoke

const xtd::drawing::color xtd::drawing::color::white_smoke
static

Gets a system-defined color that has an ARGB value of 0xFFF5F5F5. This field is constant.

◆ yellow

const xtd::drawing::color xtd::drawing::color::yellow
static

Gets a system-defined color that has an ARGB value of 0xFFFFFF00. This field is constant.

Examples
fill_rectangle.cpp.

◆ yellow_green

const xtd::drawing::color xtd::drawing::color::yellow_green
static

Gets a system-defined color that has an ARGB value of 0xFF9ACD32. This field is constant.


The documentation for this class was generated from the following file: