xtd 0.2.0
Loading...
Searching...
No Matches
color_converter.h
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.h"
6#include "color.h"
7#include <xtd/static>
8
10namespace xtd {
12 namespace drawing {
25 public:
27
40 static xtd::drawing::color alpha_blend(const xtd::drawing::color& fore_core, const xtd::drawing::color& back_color, double alpha) noexcept;
41
53 static xtd::drawing::color average(const xtd::drawing::color& color1, const xtd::drawing::color& color2, double weight) noexcept;
65 static xtd::drawing::color average(const xtd::drawing::color& color1, const xtd::drawing::color& color2, double weight, bool average_alpha) noexcept;
66
73 static xtd::drawing::color bitonal(const drawing::color& color, int32 threshold, const drawing::color& upper_color, const drawing::color& lower_color) noexcept;
74
80 static xtd::drawing::color brightness(const xtd::drawing::color& color, double percent) noexcept;
81
87 static xtd::drawing::color color(const xtd::drawing::color& color, const xtd::drawing::color& value, double percent) noexcept;
88
95 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;
96
103 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;
104
110 static xtd::drawing::color contrast(const xtd::drawing::color& color, double percent) noexcept;
111
121 static xtd::drawing::color dark(const xtd::drawing::color& color, double percent) noexcept;
122
127 static xtd::drawing::color disabled(const xtd::drawing::color& fore_color, const xtd::drawing::color& back_color) noexcept;
132 static xtd::drawing::color disabled(const xtd::drawing::color& fore_color, float brightness) noexcept;
139 static xtd::drawing::color gamma_correction(const xtd::drawing::color& color, double r, double g, double b) noexcept;
140
150 static xtd::drawing::color grayscale(const xtd::drawing::color& color, double percent) noexcept;
151
156 static xtd::drawing::color hue_rotate(const xtd::drawing::color& color, int angle) noexcept;
157
166 static xtd::drawing::color invert(const xtd::drawing::color& color, double percent) noexcept;
167
177 static xtd::drawing::color light(const xtd::drawing::color& color, double percent) noexcept;
178
184 static xtd::drawing::color saturate(const xtd::drawing::color& color, double percent) noexcept;
185
195 static xtd::drawing::color sepia(const xtd::drawing::color& color, double percent) noexcept;
196
201 static xtd::drawing::color threshold(const xtd::drawing::color& color, int32 threshold) noexcept;
203 };
204 }
205}
Converts colors to and from xtd::drawing::color class. This class cannot be inherited.
Definition color_converter.h:24
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 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 spec...
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.
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,...
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 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 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 sepia(const xtd::drawing::color &color) noexcept
Creates a new sepia color of the specified color.
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 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 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 saturate(const xtd::drawing::color &color, double percent) noexcept
Creates a new color with saturation changed of the specified color.
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 invert(const xtd::drawing::color &color) noexcept
Creates a new inverted color of the specified color.
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 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 grayscale(const xtd::drawing::color &color) noexcept
Creates a new gray 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 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 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 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 light(const xtd::drawing::color &color) noexcept
Creates a new lighter color of the specified color with 33% factor.
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.
Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:49
Contains xtd::drawing::color class.
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:37
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10