xtd 1.0.0
Loading...
Searching...
No Matches
color_converter.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "color.hpp"
7#include <xtd/static>
8
10namespace xtd {
12 namespace drawing {
25 public:
27
40 [[nodiscard]] static auto alpha_blend(const xtd::drawing::color& fore_core, const xtd::drawing::color& back_color, double alpha) noexcept -> xtd::drawing::color;
41
53 [[nodiscard]] static auto average(const xtd::drawing::color& color1, const xtd::drawing::color& color2, double weight) noexcept -> xtd::drawing::color;
65 [[nodiscard]] static auto average(const xtd::drawing::color& color1, const xtd::drawing::color& color2, double weight, bool average_alpha) noexcept -> xtd::drawing::color;
66
73 [[nodiscard]] static auto bitonal(const drawing::color& color, int32 threshold, const drawing::color& upper_color, const drawing::color& lower_color) noexcept -> xtd::drawing::color;
74
80 [[nodiscard]] static auto brightness(const xtd::drawing::color& color, double percent) noexcept -> xtd::drawing::color;
81
87 [[nodiscard]] static auto color(const xtd::drawing::color& color, const xtd::drawing::color& value, double percent) noexcept -> xtd::drawing::color;
88
95 [[nodiscard]] static auto color_extraction(const xtd::drawing::color& color, int32 threshold, const drawing::color& extraction_color, const xtd::drawing::color& other_color) noexcept -> xtd::drawing::color;
96
103 [[nodiscard]] static auto color_substitution(const xtd::drawing::color& color, int32 threshold, const drawing::color& source_color, const xtd::drawing::color& new_color) noexcept -> xtd::drawing::color;
104
110 [[nodiscard]] static auto contrast(const xtd::drawing::color& color, double percent) noexcept -> xtd::drawing::color;
111
115 [[nodiscard]] static auto dark(const xtd::drawing::color& color) noexcept -> xtd::drawing::color;
121 [[nodiscard]] static auto dark(const xtd::drawing::color& color, double percent) noexcept -> xtd::drawing::color;
122
127 [[nodiscard]] static auto disabled(const xtd::drawing::color& fore_color, const xtd::drawing::color& back_color) noexcept -> xtd::drawing::color;
132 [[nodiscard]] static auto disabled(const xtd::drawing::color& fore_color, float brightness) noexcept -> xtd::drawing::color;
139 [[nodiscard]] static auto gamma_correction(const xtd::drawing::color& color, double r, double g, double b) noexcept -> xtd::drawing::color;
140
144 [[nodiscard]] static auto grayscale(const xtd::drawing::color& color) noexcept -> xtd::drawing::color;
150 [[nodiscard]] static auto grayscale(const xtd::drawing::color& color, double percent) noexcept -> xtd::drawing::color;
151
156 [[nodiscard]] static auto hue_rotate(const xtd::drawing::color& color, int angle) noexcept -> xtd::drawing::color;
157
161 [[nodiscard]] static auto invert(const xtd::drawing::color& color) noexcept -> xtd::drawing::color;
166 [[nodiscard]] static auto invert(const xtd::drawing::color& color, double percent) noexcept -> xtd::drawing::color;
167
171 [[nodiscard]] static auto light(const xtd::drawing::color& color) noexcept -> xtd::drawing::color;
177 [[nodiscard]] static auto light(const xtd::drawing::color& color, double percent) noexcept -> xtd::drawing::color;
178
184 [[nodiscard]] static auto saturate(const xtd::drawing::color& color, double percent) noexcept -> xtd::drawing::color;
185
189 [[nodiscard]] static auto sepia(const xtd::drawing::color& color) noexcept -> xtd::drawing::color;
195 [[nodiscard]] static auto sepia(const xtd::drawing::color& color, double percent) noexcept -> xtd::drawing::color;
196
201 [[nodiscard]] static auto threshold(const xtd::drawing::color& color, int32 threshold) noexcept -> xtd::drawing::color;
203 };
204 }
205}
Converts colors to and from xtd::drawing::color class. This class cannot be inherited.
Definition color_converter.hpp:24
static auto light(const xtd::drawing::color &color) noexcept -> xtd::drawing::color
Creates a new lighter color of the specified color with 33% factor.
static auto threshold(const xtd::drawing::color &color, int32 threshold) noexcept -> xtd::drawing::color
Creates a new black or white color of the specified color with specified threshold.
static auto sepia(const xtd::drawing::color &color) noexcept -> xtd::drawing::color
Creates a new sepia color of the specified color.
static auto alpha_blend(const xtd::drawing::color &fore_core, const xtd::drawing::color &back_color, double alpha) noexcept -> xtd::drawing::color
Returns the weighted average color between the two given colors.
static auto grayscale(const xtd::drawing::color &color) noexcept -> xtd::drawing::color
Creates a new gray color of the specified color.
static auto hue_rotate(const xtd::drawing::color &color, int angle) noexcept -> xtd::drawing::color
Creates a new color with rotated hue of the specified color with specified angle.
static auto invert(const xtd::drawing::color &color) noexcept -> xtd::drawing::color
Creates a new inverted color of the specified color.
static auto average(const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight, bool average_alpha) noexcept -> xtd::drawing::color
Returns the weighted average color between the two given colors.
static auto grayscale(const xtd::drawing::color &color, double percent) noexcept -> xtd::drawing::color
Creates a new gray color of the specified color with specified percent factor.
static auto color_extraction(const xtd::drawing::color &color, int32 threshold, const drawing::color &extraction_color, const xtd::drawing::color &other_color) noexcept -> xtd::drawing::color
Creates a new filtered color from specified color and replaces other color with other specified color...
static auto gamma_correction(const xtd::drawing::color &color, double r, double g, double b) noexcept -> xtd::drawing::color
Creates a new gamma corrected color of the specified color with specified r, g, b corrections.
static auto saturate(const xtd::drawing::color &color, double percent) noexcept -> xtd::drawing::color
Creates a new color with saturation changed of the specified color.
static auto disabled(const xtd::drawing::color &fore_color, float brightness) noexcept -> xtd::drawing::color
Creates a new disabled color of the specified color with specified brightness.
static auto color(const xtd::drawing::color &color, const xtd::drawing::color &value, double percent) noexcept -> xtd::drawing::color
Creates a new color with brightness changed of the specified color with specified percent.
static auto dark(const xtd::drawing::color &color, double percent) noexcept -> xtd::drawing::color
Creates a new darker color of the specified color with specified percent factor.
static auto light(const xtd::drawing::color &color, double percent) noexcept -> xtd::drawing::color
Creates a new lighter color of the specified color with specified percent factor.
static auto color_substitution(const xtd::drawing::color &color, int32 threshold, const drawing::color &source_color, const xtd::drawing::color &new_color) noexcept -> xtd::drawing::color
Creates a new color where the specified source color is replaced by the new color.
static auto disabled(const xtd::drawing::color &fore_color, const xtd::drawing::color &back_color) noexcept -> xtd::drawing::color
Creates a new disabled color of the specified color with specified reference background color.
static auto dark(const xtd::drawing::color &color) noexcept -> xtd::drawing::color
Creates a new darker color of the specified color with 33% factor.
static auto contrast(const xtd::drawing::color &color, double percent) noexcept -> xtd::drawing::color
Creates a new contrasting color of the specified color with specified percent factor.
static auto average(const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight) noexcept -> xtd::drawing::color
Returns the weighted average color between the two given colors.
static auto bitonal(const drawing::color &color, int32 threshold, const drawing::color &upper_color, const drawing::color &lower_color) noexcept -> xtd::drawing::color
Creates a new lower or upper color of the specified color with specified threshold,...
static auto sepia(const xtd::drawing::color &color, double percent) noexcept -> xtd::drawing::color
Creates a new sepia color of the specified color with specified percent factor.
static auto invert(const xtd::drawing::color &color, double percent) noexcept -> xtd::drawing::color
Creates a new inverted color of the specified color with specified percent factor.
Represents an ARGB (alpha, red, green, blue) color.
Definition color.hpp:52
Contains xtd::drawing::color class.
Contains drawing_export_ keyword.
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.hpp:38
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8