xtd 0.2.0
Loading...
Searching...
No Matches
xtd::drawing::color Class Reference
Inheritance diagram for xtd::drawing::color:
xtd::object xtd::iequatable< color > xtd::interface

Definition

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

Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:49
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
Inheritance
xtd::objectxtd::drawing::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 xtd::drawing::color::a, xtd::drawing::color::r, xtd::drawing::color::g, or xtd::drawing::color::b property, respectively. You can create a custom color by using one of the xtd::drawing::color::from_argb methods
Examples
The following code example demonstrates the xtd::drawing::color::a, xtd::drawing::color::r, xtd::drawing::color::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 xtd::forms::control::paint event-handling method, passing e as xtd::forms::paint_event_args.
void show_properties_of_slate_blue(xtd::forms::paint_event_args& e) {
string text = xtd::ustring::format("Slate blue has these ARGB values: alpha:{0}, red:{1}, green:{2}, blue:{3}", a, r, g, b);
}
xtd::byte r() const noexcept
Gets the red component value of this xtd::drawing::color class.
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:437
xtd::byte g() const noexcept
Gets the green component value of this xtd::drawing::color class.
static xtd::drawing::color from_name(const xtd::ustring &name) noexcept
Creates a xtd::drawing::color class from the specified name of a predefined color.
xtd::byte a() const noexcept
Gets the alpha component value of this xtd::drawing::color class.
xtd::byte b() const noexcept
Gets the blue component value of this xtd::drawing::color class.
Defines a particular format for text, including font face, size, and style attributes....
Definition font.h:45
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.h:35
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.h:34
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:31
Defines a xtd::drawing::brush of a single color. Brushes are used to fill graphics shapes,...
Definition solid_brush.h:30
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.h:28
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:1131
uint_least8_t byte
Represents a 8-bit unsigned integer.
Definition types.h:41
@ e
The E key.
Examples
border_style.cpp, button_renderer.cpp, check_box_renderer.cpp, color_dialog.cpp, colored_tab_pages.cpp, draw_point.cpp, fill_ellipse.cpp, fill_rectangle.cpp, fill_rounded_rectangle.cpp, font_box.cpp, graph_control.cpp, line.cpp, minesweeper.cpp, owner_button.cpp, painting.cpp, radio_button_renderer.cpp, status_bar.cpp, test_forms.cpp, and toggle_button2.cpp.

Public Fields

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

Public Constructors

 color ()=default
 Initialize a new instance of xtd::drawing::color class.
 

Public Properties

xtd::byte a () const noexcept
 Gets the alpha component value of this xtd::drawing::color class.
 
xtd::byte b () const noexcept
 Gets the blue component value of this xtd::drawing::color class.
 
xtd::byte g () const noexcept
 Gets the green component value of this xtd::drawing::color class.
 
intptr handle () const noexcept
 Gets the native handle of this xtd::drawing::color class.
 
bool is_dark () const noexcept
 Gets a value indicating wheter this xtd::drawing::color structure is dark color.
 
bool is_empty () const noexcept
 Specifies whether this xtd::drawing::color class is uninitialized.
 
bool is_known_color () const noexcept
 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.
 
bool is_light () const noexcept
 Gets a value indicating wheter this xtd::drawing::color structure is light color.
 
bool is_named_color () const noexcept
 Gets a value indicating whether this xtd::drawing::color structure is a named color or a member of the xtd::drawing::known_color enumeration.
 
bool is_system_color () const noexcept
 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.
 
xtd::ustring name () const noexcept
 Gets the name of this xtd::drawing::color.
 
xtd::byte r () const noexcept
 Gets the red component value of this xtd::drawing::color class.
 

Public Methods

bool equals (const color &value) const noexcept override
 
float get_brightness () const noexcept
 Gets the hue-saturation-brightness (HSB) brightness value for this xtd::drawing::color structure.
 
float get_hue () const noexcept
 Gets the hue-saturation-brightness (HSB) hue value, in degrees, for this xtd::drawing::color structure.
 
float get_lightness () const noexcept
 Gets the hue-saturation-lightness (HSL) lightness value for this xtd::drawing::color structure.
 
float get_saturation () const noexcept
 Gets the hue-saturation-brightness (HSB) saturation value for this xtd::drawing::color structure.
 
float get_u () const noexcept
 Gets the Y'UV color model U (chroma) value for this xtd::drawing::color structure.
 
float get_v () const noexcept
 Gets the Y'UV color model V (chroma) value for this xtd::drawing::color structure.
 
float get_y () const noexcept
 Gets the Y'UV color model Y (luma) value for this xtd::drawing::color structure.
 
uint32 to_argb () const noexcept
 Gets the 32-bit ARGB value of this xtd::drawing::color class.
 
xtd::drawing::known_color to_known_color () const noexcept
 Gets the xtd::drawing::known_color value of this xtd::drawing::color class.
 
xtd::ustring to_string () const noexcept override
 Creates a human-readable string that represents this color class.
 

Public Static Methods

static color average (const color &color1, const color &color2, double weight) noexcept
 Returns the weighted average color between the two given colors.
 
static color average (const color &color1, const color &color2, double weight, bool average_alpha) noexcept
 Returns the weighted average color between the two given colors.
 
static color dark (const color &color) noexcept
 Creates a new darker color of the specified color with 33% factor.
 
static color dark (const color &color, double percent) noexcept
 Creates a new darker color of the specified color with specified percent factor.
 
static xtd::drawing::color from_argb (uint32 argb) noexcept
 Creates a xtd::drawing::color class from a 32-bit ARGB value.
 
static xtd::drawing::color from_argb (xtd::byte alpha, const xtd::drawing::color &base_color) noexcept
 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.
 
static xtd::drawing::color from_argb (xtd::byte alpha, xtd::byte red, xtd::byte green, xtd::byte blue) noexcept
 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.
 
static xtd::drawing::color from_argb (xtd::byte red, xtd::byte green, xtd::byte blue) noexcept
 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.
 
static xtd::drawing::color from_handle (intptr handle) noexcept
 Creates a xtd::drawing::color class from native handle.
 
static xtd::drawing::color from_hsb (float hue, float saturation, float brightness) noexcept
 Creates a xtd::drawing::color class from the three HSV component (hue, saturation, and brightness) values.
 
static xtd::drawing::color from_hsl (float hue, float saturation, float lightness) noexcept
 Creates a xtd::drawing::color class from the three HSL component (hue, saturation, and lightness) values.
 
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.
 
static xtd::drawing::color from_name (const xtd::ustring &name) noexcept
 Creates a xtd::drawing::color class from the specified name of a predefined color.
 
static xtd::drawing::color from_yuv (float y, float u, float v) noexcept
 Creates a xtd::drawing::color class from the three YUV components (luma and choma) values.
 
static color light (const color &color) noexcept
 Creates a new lighter color of the specified color with 33% factor.
 
static color light (const color &color, double percent) noexcept
 Creates a new lighter color of the specified color with specified percent factor.
 
static xtd::drawing::color parse (const xtd::ustring &color) noexcept
 Creates a xtd::drawing::color class from the specified name.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const noexcept
 Creates a shallow copy of the current object.
 
- Public Member Functions inherited from xtd::iequatable< color >
virtual bool equals (const color &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- 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.
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ color()

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

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

Examples
color_dialog.cpp.

Member Function Documentation

◆ a()

xtd::byte xtd::drawing::color::a ( ) const
noexcept

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 xtd::drawing::color::a value of 255 represents an opaque color. An xtd::drawing::color::a value from 1 through 254 represents a semitransparent color. The color becomes more opaque as xtd::drawing::color::a approaches 255.
Examples
The following code example demonstrates the xtd::drawing::color::a, xtd::drawing::color::r, xtd::drawing::color::g, and xtd::drawing::color::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 xtd::forms::control::paint event-handling method, passing e as xtd::forms::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 
)
staticnoexcept

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.
Deprecated:
Replaced by xtd::drawing::color_converter::average - Will be removed in version 0.4.0

◆ average() [2/2]

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

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.
Deprecated:
Replaced by xtd::drawing::color_converter::average - Will be removed in version 0.4.0

◆ b()

xtd::byte xtd::drawing::color::b ( ) const
noexcept

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 xtd::drawing::color::a value of 255 represents an opaque color. An xtd::drawing::color::a value from 1 through 254 represents a semitransparent color. The color becomes more opaque as xtd::drawing::color::a approaches 255.
Examples
The following code example demonstrates the xtd::drawing::color::a, xtd::drawing::color::r, xtd::drawing::color::g, and xtd::drawing::color::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 xtd::forms::control::paint event-handling method, passing e as xtd::forms::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)
staticnoexcept

Creates a new darker color of the specified color with 33% factor.

Parameters
colorThe color to dark.
Returns
The new color.
Deprecated:
Replaced by xtd::drawing::color_converter::dark - Will be removed in version 0.4.0

◆ dark() [2/2]

static color xtd::drawing::color::dark ( const color color,
double  percent 
)
staticnoexcept

Creates a new darker color of the specified color with specified percent factor.

Parameters
colorThe color to dark.
percentThe darker factor in % (from 0.0 to 1.0).
Returns
The new color.
Remarks
Thus, a percent value of 1.0 will return the xtd::drawing::color::black, while a value of 0.0 will return the color.

◆ from_argb() [1/4]

static xtd::drawing::color xtd::drawing::color::from_argb ( uint32  argb)
staticnoexcept

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

Parameters
argbA value specifying the 32-bit ARGB value
Returns
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 xtd::forms::paint_event_args e, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:
  • Creates three brushes, each a different color. Each xtd::drawing::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 argb) noexcept
    Creates a xtd::drawing::color class from a 32-bit ARGB value.
    Defines an object used to draw lines and curves. This class cannot be inherited.
    Definition graphics.h:70
Examples
image_converter.cpp.

◆ from_argb() [2/4]

static xtd::drawing::color xtd::drawing::color::from_argb ( xtd::byte  alpha,
const xtd::drawing::color base_color 
)
staticnoexcept

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.
base_colorThe 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 xtd::forms::paint_event_args e, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:
  • Creates xtd::drawing::color structures from the three color component values (red, green, blue). Three xtd::drawing::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:215
    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:404
    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:89
    @ y
    The Y key.
    @ x
    The X key.

◆ from_argb() [3/4]

static xtd::drawing::color xtd::drawing::color::from_argb ( xtd::byte  alpha,
xtd::byte  red,
xtd::byte  green,
xtd::byte  blue 
)
staticnoexcept

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 xtd::forms::paint_event_args e, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:
  • Creates three brushes, each a different color. Each xtd::drawing::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 ( xtd::byte  red,
xtd::byte  green,
xtd::byte  blue 
)
staticnoexcept

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 xtd::forms::paint_event_args e, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:
  • Creates xtd::drawing::color structures from the three color component values (red, green, blue). Three xtd::drawing::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  handle)
staticnoexcept

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 
)
staticnoexcept

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.
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.

◆ from_hsl()

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

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.
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.

◆ from_known_color()

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

Creates a xtd::drawing::color class from the four ARGB component (alpha, red, green, and blue) values. Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits.

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

◆ from_name()

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

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 xtd::drawing::color::from_name 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 xtd::drawing::color::a, xtd::drawing::color::r, xtd::drawing::color::g, and xtd::drawing::color::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 xtd::forms::control::paint event-handling method, passing e as xtd::forms::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);
}

◆ from_yuv()

static xtd::drawing::color xtd::drawing::color::from_yuv ( float  y,
float  u,
float  v 
)
staticnoexcept

Creates a xtd::drawing::color class from the three YUV components (luma and choma) values.

Parameters
yThe Y'UV Y value of this xtd::drawing::color. The y ranges from 0.0 through 1.0, where 0.0 represents black and 1.0 represents white.
uThe Y'UV U value of this xtd::drawing::color. The y ranges from -0.5 through0.5. When U and V are both 0, the color is neutral (gray). Positive U values represent the red-green axis, and positive V values represent the blue-yellow axis
vThe Y'UV V value of this xtd::drawing::color. The y ranges from -0.5 through0.5. When U and V are both 0, the color is neutral (gray). Positive U values represent the red-green axis, and positive V values represent the blue-yellow axis
Returns
xtd::drawing::color The xtd::drawing::color structure that this method creates.

◆ g()

xtd::byte xtd::drawing::color::g ( ) const
noexcept

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 xtd::drawing::color::a value of 255 represents an opaque color. An xtd::drawing::color::a value from 1 through 254 represents a semitransparent color. The color becomes more opaque as xtd::drawing::color::a approaches 255.
Examples
The following code example demonstrates the xtd::drawing::color::a, xtd::drawing::color::r, xtd::drawing::color::g, and xtd::drawing::color::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 xtd::forms::control::paint event-handling method, passing e as xtd::forms::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
noexcept

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 xtd::forms::paint_event_args, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:

◆ get_hue()

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

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 xtd::forms::paint_event_args, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:

◆ get_lightness()

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

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
noexcept

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 xtd::forms::paint_event_args, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:

◆ get_u()

float xtd::drawing::color::get_u ( ) const
noexcept

Gets the Y'UV color model U (chroma) value for this xtd::drawing::color structure.

Returns
The Y'UV U value of this xtd::drawing::color. The y ranges from -0.5 through0.5. When U and V are both 0, the color is neutral (gray). Positive U values represent the red-green axis, and positive V values represent the blue-yellow axis

◆ get_v()

float xtd::drawing::color::get_v ( ) const
noexcept

Gets the Y'UV color model V (chroma) value for this xtd::drawing::color structure.

Returns
The Y'UV V value of this xtd::drawing::color. The y ranges from -0.5 through0.5. When U and V are both 0, the color is neutral (gray). Positive U values represent the red-green axis, and positive V values represent the blue-yellow axis

◆ get_y()

float xtd::drawing::color::get_y ( ) const
noexcept

Gets the Y'UV color model Y (luma) value for this xtd::drawing::color structure.

Returns
The Y'UV Y value of this xtd::drawing::color. The y ranges from 0.0 through 1.0, where 0.0 represents black and 1.0 represents white.

◆ handle()

intptr xtd::drawing::color::handle ( ) const
noexcept

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

Remarks
For internal use only, needed for system_colors.

◆ is_dark()

bool xtd::drawing::color::is_dark ( ) const
noexcept

Gets a value indicating wheter this xtd::drawing::color structure is dark color.

Remarks
return true if dark color; otherwise false.
Examples
border_style.cpp.

◆ is_empty()

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

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
noexcept

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 xtd::drawing::color::from_argb method, is_known_color returns false, even if the ARGB value matches the ARGB value of a predefined color.

◆ is_light()

bool xtd::drawing::color::is_light ( ) const
noexcept

Gets a value indicating wheter this xtd::drawing::color structure is light color.

Remarks
return true if light color; otherwise false.

◆ is_named_color()

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

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 xtd::drawing::color::from_name method or the xtd::drawing::color::from_known_color method; otherwise, false.

◆ is_system_color()

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

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 xtd::drawing::color::from_name method or the xtd::drawing::color::from_known_color method; otherwise, false.

◆ light() [1/2]

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

Creates a new lighter color of the specified color with 33% factor.

Parameters
colorThe color to light.
Returns
The new color.
Deprecated:
Replaced by xtd::drawing::color_converter::light - Will be removed in version 0.4.0

◆ light() [2/2]

static color xtd::drawing::color::light ( const color color,
double  percent 
)
staticnoexcept

Creates a new lighter color of the specified color with specified percent factor.

Parameters
colorThe color to light.
percentThe lighter factor in % (from 0.0 to 1.0).
Returns
The new color.
Remarks
Thus, a percent value of 1.0 will return the xtd::drawing::color::black, while a value of 0.0 will return the color.
Deprecated:
Replaced by xtd::drawing::color_converter::light - Will be removed in version 0.4.0

◆ name()

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

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

Returns
string The name of this xtd::drawing::color.
Examples
colored_tab_pages.cpp.

◆ parse()

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

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()

xtd::byte xtd::drawing::color::r ( ) const
noexcept

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 xtd::drawing::color::a value of 255 represents an opaque color. An xtd::drawing::color::a value from 1 through 254 represents a semitransparent color. The color becomes more opaque as xtd::drawing::color::a approaches 255.
Examples
The following code example demonstrates the xtd::drawing::color::a, xtd::drawing::color::r, xtd::drawing::color::g, and xtd::drawing::color::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 xtd::forms::control::paint event-handling method, passing e as xtd::forms::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 xtd::drawing::color::to_argb ( ) const
noexcept

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

Returns
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 xtd::forms::paint_event_args e, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:
  • Iterates through the xtd::drawing::known_color enumeration elements to find all known colors that have a non-zero green component and a zero-value red component, and that are not system colors.
  • During each iteration, saves the xtd::drawing::known_color element - if it matches the criteria - in an array.
  • Uses a brush to paint rectangles. Each of the rectangles is painted a xtd::drawing::known_color that matches the criteria stated in the first bullet. The name of the xtd::drawing::known_color and its component values are also displayed. This example displays certain known colors, the names of the colors, and their four component values. The xtd::drawing::color::to_argb method is used as a preliminary step to display the component values.
    void to_argb_to_string_example1(paint_event_args& e) {
    graphics g = e.graphics();
    // Color structure used for temporary storage.
    color some_color = color::from_argb(0);
    // Vector to store known_color values that match the criteria.
    std::vector<known_color> color_matches;
    // Iterate through the KnownColor enums to find all corresponding colors
    // that have a nonzero green component and zero-value red component and
    // that are not system colors.
    for (int enum_value = 0; enum_value <= static_cast<int>(known_color::yellow_green); ++enum_value) {
    some_color = color::from_known_color(static_cast<known_color>(enum_value));
    if (some_color.g() != 0 && some_color.r() == 0 && !some_color.is_system_color())
    color_matches.emplace_back(static_cast<known_color>(enum_value));
    }
    solid_brush my_brush1 {some_color};
    font my_font {"Arial", 9};
    int x = 40;
    int y = 40;
    // 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 known_color and the ARGB components.
    for (size_t i = 0; i < color_matches.size(); ++i) {
    // Display the color.
    some_color = color::from_known_color(color_matches[i]);
    my_brush1.color(some_color);
    g.fill_rectangle(my_brush1, x, y, 50, 30);
    // Display known_color name and the four component values. To display the
    // component values: Use the to_argb method to get the 32-bit ARGB value
    // of some_color, which was created from a known_color. Then create a
    // color structure from the 32-bit ARGB value and set some_color equal to
    // this new color structure. Then use the to_string method to convert it to
    // a string.
    g.draw_string(some_color.to_string(), my_font, brushes::black(), x + 55, y);
    some_color = color::from_argb(some_color.to_argb());
    g.draw_string(some_color.to_string(), my_font, brushes::black(), x + 55, y + 15);
    y += 40;
    }
    }
    uint32 to_argb() const noexcept
    Gets the 32-bit ARGB value of this xtd::drawing::color class.
    bool is_system_color() const noexcept
    Gets a value indicating whether this xtd::drawing::color structure is a system color....

◆ to_known_color()

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

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 xtd::drawing::color::from_name method or the xtd::drawing::color::from_known_color 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 xtd::drawing::color::to_known_color method is applied to a xtd::drawing::color structure that is created by using the FromArgb method, xtd::drawing::color::to_known_color returns 0, even if the ARGB value matches the ARGB value of a predefined color. xtd::drawing::color::to_known_color also returns 0 when it is applied to a xtd::drawing::color structure that is created by using the xtd::drawing::color::from_name 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 xtd::forms::paint_event_args, which is a parameter of the xtd::forms::control::paint event handler. The code performs the following actions:

Reimplemented from xtd::object.

Examples
button_renderer.cpp, check_box_renderer.cpp, and radio_button_renderer.cpp.

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, and test_forms.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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ lightness_threshold

constexpr double xtd::drawing::color::lightness_threshold
staticconstexpr

Represent the lightness threshold.

Remarks
If color::get_lightness() less than lightness_threshold is dark color; otherwise is light color.

◆ 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, and test_forms.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.

◆ 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.

◆ 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.

Remarks
The value is 0x00FFFFFF unlike the value defined by css, which is 0x00000000.

◆ 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.

◆ 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.

◆ 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: