xtd.forms - Reference Guide  0.1.0
Modern c++17 library containing classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and Linux like Ubuntu operating system.
xtd::forms::control_paint Class Referencefinal

Provides methods used to paint common Windows controls and their elements. This class cannot be inherited. More...

#include <control_paint.h>

Inheritance diagram for xtd::forms::control_paint:

Static Public Member Functions

static xtd::drawing::color average (const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight, bool average_alpha)
 Returns the weighted average color between the two given colors. More...
 
static xtd::drawing::color average (const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight)
 Returns the weighted average color between the two given colors. More...
 
static xtd::drawing::color dark (const xtd::drawing::color &base_color)
 Creates a new dark color object for the control from the specified color. More...
 
static xtd::drawing::color dark (const xtd::drawing::color &base_color, double perc_of_dark_dark)
 Creates a new dark color object for the control from the specified color and darkens it by the specified percentage. More...
 
static xtd::drawing::color dark_dark (const xtd::drawing::color &base_color)
 Creates a new dark color object for the control from the specified color. More...
 
static xtd::drawing::color light (const xtd::drawing::color &base_color)
 Creates a new light color object for the control from the specified color. More...
 
static xtd::drawing::color light (const xtd::drawing::color &base_color, double perc_of_light_light)
 Creates a new light color object for the control from the specified color and lightens it by the specified percentage. More...
 
static xtd::drawing::color light_light (const xtd::drawing::color &base_color)
 Creates a new light color object for the control from the specified color. More...
 
static xtd::drawing::string_format string_format (xtd::forms::text_format_flags flags)
 

Detailed Description

Provides methods used to paint common Windows controls and their elements. This class cannot be inherited.

Member Function Documentation

§ average() [1/2]

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

Returns the weighted average color between the two given colors.

Parameters
color1The first color.
color2The second color.
weightThe weighting factor
average_alphaif true alpha was comptute to; otheerwise 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.

§ average() [2/2]

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

Returns the weighted average color between the two given colors.

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

§ dark() [1/2]

static xtd::drawing::color xtd::forms::control_paint::dark ( const xtd::drawing::color base_color)
inlinestatic

Creates a new dark color object for the control from the specified color.

Parameters
colorThe xtd::drawing::color to be darkened.
Returns
A xtd::drawing::color that represents the dark color on the control.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_dark color; otherwise, the color's luminosity value is decreased.

§ dark() [2/2]

static xtd::drawing::color xtd::forms::control_paint::dark ( const xtd::drawing::color base_color,
double  perc_of_dark_dark 
)
inlinestatic

Creates a new dark color object for the control from the specified color and darkens it by the specified percentage.

Parameters
colorThe xtd::drawing::color to be darkened.
perc_of_darkThe percentage to darken the specified xtd::drawing::color.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_dark color; otherwise, the color's luminosity value is decreased.

§ dark_dark()

static xtd::drawing::color xtd::forms::control_paint::dark_dark ( const xtd::drawing::color base_color)
inlinestatic

Creates a new dark color object for the control from the specified color.

Parameters
colorThe xtd::drawing::color to be darkened.
Returns
A xtd::drawing::color that represents the dark color on the control.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_dark_dark color; otherwise, the color's luminosity value is decreased.

§ light() [1/2]

static xtd::drawing::color xtd::forms::control_paint::light ( const xtd::drawing::color base_color)
inlinestatic

Creates a new light color object for the control from the specified color.

Parameters
colorThe xtd::drawing::color to be lightened.
Returns
A xtd::drawing::color that represents the light color on the control.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_light color; otherwise, the color's luminosity value is decreased.

§ light() [2/2]

static xtd::drawing::color xtd::forms::control_paint::light ( const xtd::drawing::color base_color,
double  perc_of_light_light 
)
inlinestatic

Creates a new light color object for the control from the specified color and lightens it by the specified percentage.

Parameters
colorThe xtd::drawing::color to be lightened.
perc_of_lighttThe percentage to lighten the specified xtd::drawing::color.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_light color; otherwise, the color's luminosity value is decreased.

§ light_light()

static xtd::drawing::color xtd::forms::control_paint::light_light ( const xtd::drawing::color base_color)
inlinestatic

Creates a new light color object for the control from the specified color.

Parameters
colorThe xtd::drawing::color to be lightened.
Returns
A xtd::drawing::color that represents the light color on the control.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_light_lightk color; otherwise, the color's luminosity value is decreased.

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