xtd 0.2.0
Loading...
Searching...
No Matches
xtd::drawing::color_translator Class Referencefinal
Inheritance diagram for xtd::drawing::color_translator:
xtd::static_object

Definition

Translates colors to and from GDI+ xtd::drawing::color structures. This class cannot be inherited.

Translates colors to and from GDI+ xtd::drawing::color structures. This class cannot be inherited.
Definition color_translator.h:25
#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
Inheritance
xtd::static_objectxtd::drawing::color_translator
Namespace
xtd::drawing
Library
xtd.drawing

Public Static Methods

static xtd::drawing::color from_hex (const xtd::ustring &text)
 Translates an HEX color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::drawing::color from_hsl (const xtd::ustring &text)
 Translates an HSL color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::drawing::color from_hsla (const xtd::ustring &text)
 Translates an HSLA color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::drawing::color from_hsv (const xtd::ustring &text)
 Translates an HSV color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::drawing::color from_hsva (const xtd::ustring &text)
 Translates an HSVVA color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::drawing::color from_html (const xtd::ustring &text)
 Translates an HTML color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::drawing::color from_rgb (const xtd::ustring &text)
 Translates an RGB color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::drawing::color from_rgba (const xtd::ustring &text)
 Translates an RGBA color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::drawing::color from_win32 (int32 value)
 Translates a Win32 color representation to a GDI+ xtd::drawing::color structure.
 
static xtd::ustring to_hex (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to an HEX string color representation.
 
static xtd::ustring to_hex (const xtd::drawing::color &value, bool auto_hexa) noexcept
 Translates the specified xtd::drawing::color structure to an HEX string color representation.
 
static xtd::ustring to_hsl (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to an HSL string color representation.
 
static xtd::ustring to_hsl (const xtd::drawing::color &value, bool auto_alpha) noexcept
 Translates the specified xtd::drawing::color structure to an HSL string color representation.
 
static xtd::ustring to_hsla (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to an HSLA string color representation.
 
static xtd::ustring to_hsv (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to an HSV string color representation.
 
static xtd::ustring to_hsv (const xtd::drawing::color &value, bool auto_hsva) noexcept
 Translates the specified xtd::drawing::color structure to an HSV string color representation.
 
static xtd::ustring to_hsva (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to an HSVA string color representation.
 
static xtd::ustring to_html (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to an HTML string color representation.
 
static xtd::ustring to_rgb (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to an RGB string color representation.
 
static xtd::ustring to_rgb (const xtd::drawing::color &value, bool auto_rgba) noexcept
 Translates the specified xtd::drawing::color structure to an RGB string color representation.
 
static xtd::ustring to_rgba (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to an RGBA string color representation.
 
static int32 to_win32 (const xtd::drawing::color &value) noexcept
 Translates the specified xtd::drawing::color structure to a Windows color.
 

Member Function Documentation

◆ from_hex()

static xtd::drawing::color xtd::drawing::color_translator::from_hex ( const xtd::ustring text)
static

Translates an HEX color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the HTMLS color to translate.
Returns
The xtd::drawing::color structure that represents the translated HEX color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid HEX color name.

◆ from_hsl()

static xtd::drawing::color xtd::drawing::color_translator::from_hsl ( const xtd::ustring text)
static

Translates an HSL color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the HSL color to translate.
Returns
The xtd::drawing::color structure that represents the translated HSL color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid HSL color name.

◆ from_hsla()

static xtd::drawing::color xtd::drawing::color_translator::from_hsla ( const xtd::ustring text)
static

Translates an HSLA color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the HSLA color to translate.
Returns
The xtd::drawing::color structure that represents the translated HSLA color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid HSLA color name.

◆ from_hsv()

static xtd::drawing::color xtd::drawing::color_translator::from_hsv ( const xtd::ustring text)
static

Translates an HSV color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the HSV color to translate.
Returns
The xtd::drawing::color structure that represents the translated HSV color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid HSV color name.

◆ from_hsva()

static xtd::drawing::color xtd::drawing::color_translator::from_hsva ( const xtd::ustring text)
static

Translates an HSVVA color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the HTML color to translate.
Returns
The xtd::drawing::color structure that represents the translated HSVA color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid HSVA color name.

◆ from_html()

static xtd::drawing::color xtd::drawing::color_translator::from_html ( const xtd::ustring text)
static

Translates an HTML color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the HTML color to translate.
Returns
The xtd::drawing::color structure that represents the translated HTML color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid HTML color name.
Remarks
This method translates a string representation of an HTML color name, such as bBlue or red, to a GDI+ xtd::drawing::color structure.

◆ from_rgb()

static xtd::drawing::color xtd::drawing::color_translator::from_rgb ( const xtd::ustring text)
static

Translates an RGB color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the RGB color to translate.
Returns
The xtd::drawing::color structure that represents the translated RGB color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid RGB color name.

◆ from_rgba()

static xtd::drawing::color xtd::drawing::color_translator::from_rgba ( const xtd::ustring text)
static

Translates an RGBA color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the RGBA color to translate.
Returns
The xtd::drawing::color structure that represents the translated RGBA color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid RGBA color name.

◆ from_win32()

static xtd::drawing::color xtd::drawing::color_translator::from_win32 ( int32  value)
static

Translates a Win32 color representation to a GDI+ xtd::drawing::color structure.

Parameters
textThe string representation of the Win32 color to translate.
Returns
The xtd::drawing::color structure that represents the translated Win32 color or xtd::drawing::color::empty if text is empty ("").
Exceptions
xtd:format_exceptiontext is not a valid Win32 color name.

◆ to_hex() [1/2]

static xtd::ustring xtd::drawing::color_translator::to_hex ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HEX string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The string that represents the HEX color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a HEX color (e.g. "#ff6347").

◆ to_hex() [2/2]

static xtd::ustring xtd::drawing::color_translator::to_hex ( const xtd::drawing::color value,
bool  auto_hexa 
)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HEX string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The string that represents the HEX color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a HEX color (e.g. "#ff6347").

◆ to_hsl() [1/2]

static xtd::ustring xtd::drawing::color_translator::to_hsl ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HSL string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
auto_alphaIf true and alpha channel is not 100% shows alpha value; otherwise always not show alpha value.
Returns
The string that represents the HSL color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a HSL color (e.g. "hsl(9, 100%, 64%)").

◆ to_hsl() [2/2]

static xtd::ustring xtd::drawing::color_translator::to_hsl ( const xtd::drawing::color value,
bool  auto_alpha 
)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HSL string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
auto_hslaIf true and alpha channel is not 100% use HSLA; otherwise always use HSL.
Returns
The string that represents the HSL color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a HSL color (e.g. "hsl(9, 100%, 64%)").

◆ to_hsla()

static xtd::ustring xtd::drawing::color_translator::to_hsla ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HSLA string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The string that represents the HSL color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a HSLA color (e.g. "hsla(9, 100%, 64%, 0.6)").

◆ to_hsv() [1/2]

static xtd::ustring xtd::drawing::color_translator::to_hsv ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HSV string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The string that represents the HSL color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a HSV color (e.g. "hsl(9, 100%, 64%)").

◆ to_hsv() [2/2]

static xtd::ustring xtd::drawing::color_translator::to_hsv ( const xtd::drawing::color value,
bool  auto_hsva 
)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HSV string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
auto_hsvaIf true and alpha channel is not 100% use HSLA; otherwise always use HSL.
Returns
The string that represents the HSL color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a HSV color (e.g. "hsl(9, 100%, 64%)").

◆ to_hsva()

static xtd::ustring xtd::drawing::color_translator::to_hsva ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HSVA string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The string that represents the HSL color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a HSVA color (e.g. "hsva(9, 100%, 64%, 0.6)").

◆ to_html()

static xtd::ustring xtd::drawing::color_translator::to_html ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to an HTML string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The string that represents the HTML color.
Remarks
This method translates a xtd::drawing::color structure to a string representation of an HTML color. This is the commonly used name of a color, such as "red", "blue", or "green", and not string representation of a numeric color value, such as "#ff6347" or "rgba(255, 99, 71, 0.5)" if alpha less than 255.

◆ to_rgb() [1/2]

static xtd::ustring xtd::drawing::color_translator::to_rgb ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to an RGB string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The string that represents the RGB color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a RGB color (e.g."rgb(255, 99, 71)").

◆ to_rgb() [2/2]

static xtd::ustring xtd::drawing::color_translator::to_rgb ( const xtd::drawing::color value,
bool  auto_rgba 
)
staticnoexcept

Translates the specified xtd::drawing::color structure to an RGB string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
auto_rgbaIf true and alpha channel is not 100% use RGB; otherwise always use RGB.
Returns
The string that represents the RGB color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a RGB color (e.g."rgb(255, 99, 71)").

◆ to_rgba()

static xtd::ustring xtd::drawing::color_translator::to_rgba ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to an RGBA string color representation.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The string that represents the RGBA color.
Remarks
This method translates an xtd::drawing::color structure into a string representation of a RGBA color (e.g."rgba(255, 99, 71, 0.5)").

◆ to_win32()

static int32 xtd::drawing::color_translator::to_win32 ( const xtd::drawing::color value)
staticnoexcept

Translates the specified xtd::drawing::color structure to a Windows color.

Parameters
valueThe xtd::drawing::color structure to translate.
Returns
The Windows color value.

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