VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CColor Struct Reference

RGBA Color structure. More...

## Public Member Functions
constexpr | CColor ()=default
constexpr | CColor (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=255)
constexpr | CColor (const CColor &inColor)
bool | fromString (UTF8StringPtr str)
UTF8String | toString () const
Operator Methods
CColor & | operator() (uint8_t _red, uint8_t _green, uint8_t _blue, uint8_t _alpha)
CColor & | operator= (const CColor &newColor)
bool | operator!= (const CColor &other) const
bool | operator== (const CColor &other) const
Convert Methods
void | toHSV (double &hue, double &saturation, double &value) const
| convert to hue, saturation and value
void | fromHSV (double hue, double saturation, double value)
| convert from hue, saturation and value
void | toHSL (double &hue, double &saturation, double &lightness) const
| convert to hue, saturation and lightness
void | fromHSL (double hue, double saturation, double lightness)
| convert from hue, saturation and lightness
constexpr uint8_t | getLuma () const
| get the luma of the color
uint8_t | getLightness () const
| get the lightness of the color
template<typename T >
constexpr T | normRed () const
| get the normalized red value
template<typename T >
constexpr T | normGreen () const
| get the normalized green value
template<typename T >
constexpr T | normBlue () const
| get the normalized blue value
template<typename T >
constexpr T | normAlpha () const
| get the normalized alpha value
template<typename T >
void | setNormRed (T v)
| set the red value normalized
template<typename T >
void | setNormGreen (T v)
| set the green value normalized
template<typename T >
void | setNormBlue (T v)
| set the blue value normalized
template<typename T >
void | setNormAlpha (T v)
| set the alpha value normalized

## Static Public Member Functions
static bool | isColorRepresentation (UTF8StringPtr str)

## Public Attributes
uint8_t | red {255}
| red component [0..255]
uint8_t | green {255}
| green component [0..255]
uint8_t | blue {255}
| blue component [0..255]
uint8_t | alpha {255}
| alpha component [0..255]

## Detailed Description

RGBA Color structure.

## Constructor & Destructor Documentation

constexpr CColor | ( |  | ) |
| default

constexpr CColor | ( | uint8_t | red,
|  | uint8_t | green,
|  | uint8_t | blue,
|  | uint8_t | alpha = `255`
| ) |  |
| inline

constexpr CColor | ( | const CColor & | inColor | ) |
| inline

## Member Function Documentation

void fromHSL | ( | double | hue,
|  | double | saturation,
|  | double | lightness
| ) |  |

convert from hue, saturation and lightness

Parameters

  hue | in degree [0..360]
  saturation | normalized [0..1]
  lightness | normalized [0..1]

void fromHSV | ( | double | hue,
|  | double | saturation,
|  | double | value
| ) |  |

convert from hue, saturation and value

Parameters

  hue | in degree [0..360]
  saturation | normalized [0..1]
  value | normalized [0..1]

bool fromString | ( | UTF8StringPtr | str | ) |

uint8_t getLightness | ( |  | ) | const

get the lightness of the color

constexpr uint8_t getLuma | ( |  | ) | const
| inline

get the luma of the color

bool isColorRepresentation | ( | UTF8StringPtr | str | ) |
| static

constexpr T normAlpha | ( |  | ) | const

get the normalized alpha value

constexpr T normBlue | ( |  | ) | const

get the normalized blue value

constexpr T normGreen | ( |  | ) | const

get the normalized green value

constexpr T normRed | ( |  | ) | const

get the normalized red value

bool operator!= | ( | const CColor & | other | ) | const
| inline

CColor& operator() | ( | uint8_t | _red,
|  | uint8_t | _green,
|  | uint8_t | _blue,
|  | uint8_t | _alpha
| ) |  |
| inline

CColor& operator= | ( | const CColor & | newColor | ) |
| inline

bool operator== | ( | const CColor & | other | ) | const
| inline

void setNormAlpha | ( | T | v | ) |

set the alpha value normalized

void setNormBlue | ( | T | v | ) |

set the blue value normalized

void setNormGreen | ( | T | v | ) |

set the green value normalized

void setNormRed | ( | T | v | ) |

set the red value normalized

void toHSL | ( | double & | hue,
|  | double & | saturation,
|  | double & | lightness
| ) |  | const

convert to hue, saturation and lightness

Parameters

  hue | in degree [0..360]
  saturation | normalized [0..1]
  lightness | normalized [0..1]

void toHSV | ( | double & | hue,
|  | double & | saturation,
|  | double & | value
| ) |  | const

convert to hue, saturation and value

Parameters

  hue | in degree [0..360]
  saturation | normalized [0..1]
  value | normalized [0..1]

UTF8String toString | ( |  | ) | const

## Member Data Documentation

uint8_t alpha {255}

alpha component [0..255]

uint8_t blue {255}

blue component [0..255]

uint8_t green {255}

green component [0..255]

uint8_t red {255}

red component [0..255]

The documentation for this struct was generated from the following files:

- ccolor.h
- ccolor.cpp