Converts colors to and from xtd::drawing::color class. This class cannot be inherited.
Public Static Methods | |
static xtd::drawing::color | alpha_blend (const xtd::drawing::color &fore_core, const xtd::drawing::color &back_color, double alpha) noexcept |
Returns the weighted average color between the two given colors. | |
static xtd::drawing::color | average (const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight) noexcept |
Returns the weighted average color between the two given colors. | |
static xtd::drawing::color | average (const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight, bool average_alpha) noexcept |
Returns the weighted average color between the two given colors. | |
static xtd::drawing::color | bitonal (const drawing::color &color, int32 threshold, const drawing::color &upper_color, const drawing::color &lower_color) noexcept |
Creates a new lower or upper color of the specified color with specified threshold, upper color, and lower color. | |
static xtd::drawing::color | brightness (const xtd::drawing::color &color, double percent) noexcept |
Creates a new color with brightness changed of the specified color with specified percent. | |
static xtd::drawing::color | color (const xtd::drawing::color &color, const xtd::drawing::color &value, double percent) noexcept |
Create a new color with specified value that will be added/removed from the specified color with specified percent. | |
static xtd::drawing::color | color_extraction (const xtd::drawing::color &color, int32 threshold, const drawing::color &extraction_color, const xtd::drawing::color &other_color) noexcept |
Creates a new filtered color from specified color and replaces other color with other specified color. | |
static xtd::drawing::color | color_substitution (const xtd::drawing::color &color, int32 threshold, const drawing::color &source_color, const xtd::drawing::color &new_color) noexcept |
Creates a new color where the specified source color is replaced by the new color. | |
static xtd::drawing::color | contrast (const xtd::drawing::color &color, double percent) noexcept |
Creates a new contrasting color of the specified color with specified percent factor. | |
static xtd::drawing::color | dark (const xtd::drawing::color &color) noexcept |
Creates a new darker color of the specified color with 33% factor. | |
static xtd::drawing::color | dark (const xtd::drawing::color &color, double percent) noexcept |
Creates a new darker color of the specified color with specified percent factor. | |
static xtd::drawing::color | disabled (const xtd::drawing::color &fore_color, const xtd::drawing::color &back_color) noexcept |
Creates a new disabled color of the specified color with specified reference background color. | |
static xtd::drawing::color | disabled (const xtd::drawing::color &fore_color, float brightness) noexcept |
Creates a new disabled color of the specified color with specified brightness. | |
static xtd::drawing::color | gamma_correction (const xtd::drawing::color &color, double r, double g, double b) noexcept |
Creates a new gamma corrected color of the specified color with specified r, g, b corrections. | |
static xtd::drawing::color | grayscale (const xtd::drawing::color &color) noexcept |
Creates a new gray color of the specified color. | |
static xtd::drawing::color | grayscale (const xtd::drawing::color &color, double percent) noexcept |
Creates a new gray color of the specified color with specified percent factor. | |
static xtd::drawing::color | hue_rotate (const xtd::drawing::color &color, int angle) noexcept |
Creates a new color with rotated hue of the specified color with specified angle. | |
static xtd::drawing::color | invert (const xtd::drawing::color &color) noexcept |
Creates a new inverted color of the specified color. | |
static xtd::drawing::color | invert (const xtd::drawing::color &color, double percent) noexcept |
Creates a new inverted color of the specified color with specified percent factor. | |
static xtd::drawing::color | light (const xtd::drawing::color &color) noexcept |
Creates a new lighter color of the specified color with 33% factor. | |
static xtd::drawing::color | light (const xtd::drawing::color &color, double percent) noexcept |
Creates a new lighter color of the specified color with specified percent factor. | |
static xtd::drawing::color | saturate (const xtd::drawing::color &color, double percent) noexcept |
Creates a new color with saturation changed of the specified color. | |
static xtd::drawing::color | sepia (const xtd::drawing::color &color) noexcept |
Creates a new sepia color of the specified color. | |
static xtd::drawing::color | sepia (const xtd::drawing::color &color, double percent) noexcept |
Creates a new sepia color of the specified color with specified percent factor. | |
static xtd::drawing::color | threshold (const xtd::drawing::color &color, int32 threshold) noexcept |
Creates a new black or white color of the specified color with specified threshold. | |
|
staticnoexcept |
Returns the weighted average color between the two given colors.
fore_core | The foreground color. |
back_color | The background color. |
alpha | The alpha factor |
1.0
will return the background color, while a value of 0.0
will return the foreground color.
|
staticnoexcept |
Returns the weighted average color between the two given colors.
color1 | The first color. |
color2 | The second color. |
weight | The weighting factor |
1.0
will return the second color, while a value of 0.0
will return the first color.
|
staticnoexcept |
Returns the weighted average color between the two given colors.
color1 | The first color. |
color2 | The second color. |
weight | The weighting factor |
average_alpha | if true alpha was compute to; otherwise the alpha result is the alpha of color1 |
|
staticnoexcept |
Creates a new lower or upper color of the specified color with specified threshold, upper color, and lower color.
color | The color to threshold. |
threshold | The threshold value (from 0 to 765). |
upper_color | The color used when RGB color is upper the threshold value. |
lower_color | The color used when RGB color is under or equal the threshold value. |
|
staticnoexcept |
Creates a new color with brightness changed of the specified color with specified percent.
color | The color to brightness. |
percent | The percent factor in % (from 0.0 to 2.0). |
will make the color completely black.
1.0is default and represents the original color. Values over
1.0` will provide brighter results.
|
staticnoexcept |
Create a new color with specified value that will be added/removed from the specified color with specified percent.
color | The color to update. |
value | The value to add / remove |
percent | The percent factor in % (from 0.0 to 2.0). |
|
staticnoexcept |
Creates a new filtered color from specified color and replaces other color with other specified color.
color | The color to filter. |
threshold | The threshold value (from 0 to 765). |
extraction_color | The color to extract. |
other_color | The other color. |
|
staticnoexcept |
Creates a new color where the specified source color is replaced by the new color.
color | The color to filter. |
threshold | The threshold value (from 0 to 765). |
source_color | The source color. |
new_color | The new color. |
|
staticnoexcept |
Creates a new contrasting color of the specified color with specified percent factor.
color | The color to change contrast. |
percent | The percent factor in % (from 0.0 to 1.0). |
1.0
returns the original color, while the other values give a contrasting color.
|
staticnoexcept |
Creates a new darker color of the specified color with 33% factor.
color | The color to dark. |
|
staticnoexcept |
Creates a new darker color of the specified color with specified percent factor.
color | The color to dark. |
percent | The darker factor in % (from 0.0 to 1.0). |
1.0
will return the xtd::drawing::color::black, while a value of 0.0
will return the color.
|
staticnoexcept |
Creates a new disabled color of the specified color with specified reference background color.
fore_color | The fore color to disabled. |
back_color | The reference background color. |
|
staticnoexcept |
Creates a new disabled color of the specified color with specified brightness.
fore_color | The fore color to disabled. |
brightness | The brightness of the reference backgroung color. |
|
staticnoexcept |
Creates a new gamma corrected color of the specified color with specified r, g, b corrections.
color | The color to grayscale. |
r | The red correction from 0.1 to 5. |
g | The green correction from 0.1 to 5. |
b | The blue correction from 0.1 to 5. |
|
staticnoexcept |
Creates a new gray color of the specified color.
color | The color to grayscale. |
|
staticnoexcept |
Creates a new gray color of the specified color with specified percent factor.
color | The color to grayscale. |
percent | The percent factor. |
1.0
will make the color completely gray, while 0.0
return the original color.
|
staticnoexcept |
Creates a new color with rotated hue of the specified color with specified angle.
color | The color to rotate hue. |
angle | The angle in degrees (form 0 to 360). |
|
staticnoexcept |
Creates a new inverted color of the specified color.
color | The color to invert. |
|
staticnoexcept |
Creates a new inverted color of the specified color with specified percent factor.
color | The color to invert. |
0.0
will represents the original color. 1.0
will provide inverted color.
|
staticnoexcept |
Creates a new lighter color of the specified color with 33% factor.
color | The color to light. |
|
staticnoexcept |
Creates a new lighter color of the specified color with specified percent factor.
color | The color to light. |
percent | The lighter factor in % (from 0.0 to 1.0). |
1.0
will return the xtd::drawing::color::black, while a value of 0.0
will return the color.
|
staticnoexcept |
Creates a new color with saturation changed of the specified color.
color | The color to saturate. |
percent | The saturatiob factor in % |
1.0
return the original color. while other will make a saturate color.
|
staticnoexcept |
Creates a new sepia color of the specified color.
color | The color to sepia. |
|
staticnoexcept |
Creates a new sepia color of the specified color with specified percent factor.
color | The color to sepia. |
percent | The percent factor in % (from 0.0 to 1.0). |
1.0
will make the color completely sepia, while 0.0
return the original color.
|
staticnoexcept |
Creates a new black or white color of the specified color with specified threshold.
color | The color to threshold. |
threshold | The threshold value (from 0 to 765). |