DISTRHO Plugin Framework
|
#include <Color.hpp>
Public Member Functions | |
Color () noexcept | |
Color (int red, int green, int blue, float alpha=1.0f) noexcept | |
Color (float red, float green, float blue, float alpha=1.0f) noexcept | |
Color (const Color &color) noexcept | |
Color & | operator= (const Color &color) noexcept |
Color (const Color &color1, const Color &color2, float u) noexcept | |
Color | withAlpha (float alpha) const noexcept |
Color | minus (int value) const noexcept |
Color | minus (float value) const noexcept |
Color | plus (int value) const noexcept |
Color | plus (float value) const noexcept |
Color | invert () const noexcept |
void | interpolate (const Color &other, float u) noexcept |
bool | isEqual (const Color &color, bool withAlpha=true) noexcept |
bool | isNotEqual (const Color &color, bool withAlpha=true) noexcept |
bool | operator== (const Color &color) noexcept |
bool | operator!= (const Color &color) noexcept |
void | fixBounds () noexcept |
void | setFor (const GraphicsContext &context, bool includeAlpha=false) |
Color (const NVGcolor &) noexcept | |
operator NVGcolor () const noexcept | |
Static Public Member Functions | |
static Color | fromHSL (float hue, float saturation, float lightness, float alpha=1.0f) |
static Color | fromHTML (const char *rgb, float alpha=1.0f) noexcept |
Public Attributes | |
union { | |
float rgba [4] | |
struct { | |
float red | |
float green | |
float blue | |
float alpha | |
} | |
}; | |
A color made from red, green, blue and alpha floating-point values in [0..1] range.
|
noexcept |
Create solid black color.
|
noexcept |
Create a color from red, green, blue and alpha numeric values. All values except alpha must be in [0..255] range, with alpha in [0..1] range.
|
noexcept |
Create a color from red, green, blue and alpha floating-point values. All values must in [0..1] range.
|
noexcept |
Create a color by copying another color.
Create a color by linearly interpolating two other colors.
|
noexcept |
Create a new color based on this one but with a different alpha value.
|
noexcept |
Create a new color based on this one but with subtracted numeric value on all elements. Value must be in [0..255] range.
|
noexcept |
Create a new color based on this one but with subtracted floating-point value on all elements. Value must be in [0..1] range.
|
noexcept |
Create a new color based on this one but with added numeric value on all elements. Value must be in [0..255] range.
|
noexcept |
Create a new color based on this one but with added floating-point value on all elements. Value must be in [0..1] range.
|
noexcept |
Create a new color based on this one but colors inverted.
|
static |
Create a color specified by hue, saturation and lightness. Values must in [0..1] range.
|
staticnoexcept |
Create a color from a HTML string like "#333" or "#112233".
|
noexcept |
Linearly interpolate this color against another.
|
noexcept |
Check if this color matches another.
|
noexcept |
Fix color bounds if needed.
void Color::setFor | ( | const GraphicsContext & | context, |
bool | includeAlpha = false |
||
) |
Set this color for use in the next drawing operation for the provided context.
union { ... } |
Direct access to the color values.