Describes an RGB color, with opacity, typically for UI purposes.
More...
#include <hdicoreColor.h>
|
| | Color () |
| | Default Color constructor; makes a black and fully opaque color.
|
| | Color (const double r_, const double g_, const double b_, const double o_=1.0) |
| | Color constructor, taking an argument for each channel.
|
| | Color (const Color &c_) |
| | Color copy constructor.
|
| | Color (const ArtColor &c_) |
| | Constructs a Color object from an existing ArtColor object.
|
| virtual | ~Color () |
| | Color destructor.
|
| virtual Color | lighten (const double percentage_) const |
| | Lightens the color by a percentage.
|
| virtual Color | darken (const double percentage_) const |
| | Darkens the color by a percentage.
|
| virtual Color & | operator= (const Color &rhs_) |
| | Sets a Color object from another Color object.
|
| virtual bool | operator== (const Color &rhs_) const |
| | Tests whether a given Color object is the same as another.
|
| virtual bool | operator!= (const Color &rhs_) const |
| | Tests whether a given Color object is not the same as another.
|
|
|
double | r |
| | Red channel, in range [0.0, 1.0].
|
|
double | g |
| | Green channel, in range [0.0, 1.0].
|
|
double | b |
| | Blue channel, in range [0.0, 1.0].
|
|
double | opacity |
| | Alpha channel, in range [0.0, 1.0].
|
|
|
aip::Color * | __accessImpl (const Color &) |
|
Color | __accessCtor (const aip::Color &) |
Describes an RGB color, with opacity, typically for UI purposes.
◆ Color() [1/4]
| hdi::core::Color::Color |
( |
| ) |
|
Default Color constructor; makes a black and fully opaque color.
- Author
- GW
- Date
- 08/2013
◆ Color() [2/4]
| hdi::core::Color::Color |
( |
const double | r_, |
|
|
const double | g_, |
|
|
const double | b_, |
|
|
const double | o_ = 1.0 ) |
Color constructor, taking an argument for each channel.
- Author
- GW
- Date
- 08/2013
- Parameters
-
| r_ | Value for red channel, in range [0.0, 1.0] |
| g_ | Value for green channel, in range [0.0, 1.0] |
| b_ | Value for blue channel, in range [0.0, 1.0] |
| o_ | Value for alpha channel, in range [0.0, 1.0] |
◆ Color() [3/4]
| hdi::core::Color::Color |
( |
const Color & | c_ | ) |
|
Color copy constructor.
- Author
- GW
- Date
- 08/2013
- Parameters
-
| c_ | Existing Color object to copy values from |
◆ Color() [4/4]
| hdi::core::Color::Color |
( |
const ArtColor & | c_ | ) |
|
Constructs a Color object from an existing ArtColor object.
- Author
- GW
- Date
- 07/2025
- Parameters
-
- Warning
- This constructor cannot accomodate ArtColor objects composed of patterns or gradients; passing objects of those ArtColor::Type values will result in RGB black with opacity of 0.
◆ ~Color()
| virtual hdi::core::Color::~Color |
( |
| ) |
|
|
virtual |
Color destructor.
- Author
- GW
- Date
- 08/2013
◆ black()
| Color hdi::core::Color::black |
( |
| ) |
|
|
static |
Static accessor to get a pure black Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure black
◆ blue()
| Color hdi::core::Color::blue |
( |
| ) |
|
|
static |
Static accessor to get a pure blue Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure blue
◆ clear()
| Color hdi::core::Color::clear |
( |
| ) |
|
|
static |
Static accessor to get a Color object with opacity of 0.
- Author
- GW
- Date
- 07/2025
- Returns
- A Color object with its values set to pure black and opacity of 0
◆ cyan()
| Color hdi::core::Color::cyan |
( |
| ) |
|
|
static |
Static accessor to get a pure cyan Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure cyan
◆ darken()
| virtual Color hdi::core::Color::darken |
( |
const double | percentage_ | ) |
const |
|
virtual |
Darkens the color by a percentage.
- Author
- GW
- Date
- 08/2013
- Parameters
-
| percentage_ | Amount to darken the color brightness, in range [0.0, 1.0] |
- Returns
- The target color but darkened by the desired percentage
◆ darkGray()
| Color hdi::core::Color::darkGray |
( |
| ) |
|
|
static |
Static accessor to get a dark gray Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to 75% black
◆ gray()
| Color hdi::core::Color::gray |
( |
| ) |
|
|
static |
Static accessor to get a neutral gray Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to 50% black
◆ green()
| Color hdi::core::Color::green |
( |
| ) |
|
|
static |
Static accessor to get a pure green Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure green
◆ lighten()
| virtual Color hdi::core::Color::lighten |
( |
const double | percentage_ | ) |
const |
|
virtual |
Lightens the color by a percentage.
- Author
- GW
- Date
- 08/2013
- Parameters
-
| percentage_ | Amount to lighten the color brightness, in range [0.0, 1.0] |
- Returns
- The target color but lightened by the desired percentage
◆ lightGray()
| Color hdi::core::Color::lightGray |
( |
| ) |
|
|
static |
Static accessor to get a light gray Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to 25% black
◆ magenta()
| Color hdi::core::Color::magenta |
( |
| ) |
|
|
static |
Static accessor to get a pure magenta Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure magenta
◆ operator!=()
| virtual bool hdi::core::Color::operator!= |
( |
const Color & | rhs_ | ) |
const |
|
virtual |
Tests whether a given Color object is not the same as another.
- Author
- GW
- Date
- 08/2013
- Parameters
-
| rhs_ | Color to compare against (righthand side of inequality operator) |
- Returns
- true for the target and rhs_ being different colors, false otherwise
◆ operator=()
| virtual Color & hdi::core::Color::operator= |
( |
const Color & | rhs_ | ) |
|
|
virtual |
Sets a Color object from another Color object.
- Author
- GW
- Date
- 08/2013
- Parameters
-
| rhs_ | Color object to copy values from |
- Returns
- The target object on the lefthand side of the = operator, with its values updated
◆ operator==()
| virtual bool hdi::core::Color::operator== |
( |
const Color & | rhs_ | ) |
const |
|
virtual |
Tests whether a given Color object is the same as another.
- Author
- GW
- Date
- 08/2013
- Parameters
-
| rhs_ | Color to compare against (righthand side of equality operator) |
- Returns
- true for the target and rhs_ being the same color, false otherwise
◆ orange()
| Color hdi::core::Color::orange |
( |
| ) |
|
|
static |
Static accessor to get a pure orange Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure orange
◆ purple()
| Color hdi::core::Color::purple |
( |
| ) |
|
|
static |
Static accessor to get a pure purple Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure purple
◆ red()
| Color hdi::core::Color::red |
( |
| ) |
|
|
static |
Static accessor to get a pure red Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure red
◆ white()
| Color hdi::core::Color::white |
( |
| ) |
|
|
static |
Static accessor to get a pure white Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure white
◆ yellow()
| Color hdi::core::Color::yellow |
( |
| ) |
|
|
static |
Static accessor to get a pure yellow Color object.
- Author
- GW
- Date
- 08/2013
- Returns
- A Color object with its values set to pure yellow