Hot Door CORE 0.8.4
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdi::core::Color Class Reference

Describes an RGB color, with opacity, typically for UI purposes. More...

#include <hdicoreColor.h>

Public Member Functions

 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 Coloroperator= (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.

Static Public Member Functions

static Color red ()
 Static accessor to get a pure red Color object.
static Color orange ()
 Static accessor to get a pure orange Color object.
static Color yellow ()
 Static accessor to get a pure yellow Color object.
static Color green ()
 Static accessor to get a pure green Color object.
static Color cyan ()
 Static accessor to get a pure cyan Color object.
static Color blue ()
 Static accessor to get a pure blue Color object.
static Color purple ()
 Static accessor to get a pure purple Color object.
static Color magenta ()
 Static accessor to get a pure magenta Color object.
static Color white ()
 Static accessor to get a pure white Color object.
static Color lightGray ()
 Static accessor to get a light gray Color object.
static Color gray ()
 Static accessor to get a neutral gray Color object.
static Color darkGray ()
 Static accessor to get a dark gray Color object.
static Color black ()
 Static accessor to get a pure black Color object.
static Color clear ()
 Static accessor to get a Color object with opacity of 0.

Public Attributes

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].

Friends

aip::Color * __accessImpl (const Color &)
Color __accessCtor (const aip::Color &)

Detailed Description

Describes an RGB color, with opacity, typically for UI purposes.

Constructor & Destructor Documentation

◆ 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
c_Existing ArtColor object
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

Member Function Documentation

◆ 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