Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreColor.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_COLOR__
8#define __HDI_CORE_COLOR__
9
10#include <memory>
11
12namespace hdi
13{
14 #if defined(HDI_CORE_AIP_MODE)
15 namespace aip
16 {
17 class Color;
18 }
19 #elif defined(HDI_CORE_PSP_MODE)
20 namespace psp
21 {
22 class Color;
23 }
24 #endif
25
26 namespace core
27 {
31 class Color
32 {
33 public:
37 double r;
38
42 double g;
43
47 double b;
48
52 double opacity;
53
60
71 Color(const double r_, const double g_, const double b_, const double o_ = 1.0);
72
80 Color(const Color& c_);
81
87 virtual ~Color();
88
96 virtual void lighten(const double percentage_);
97
105 virtual void darken(const double percentage_);
106
115 virtual Color& operator=(const Color& rhs_);
116
125 virtual bool operator==(const Color& rhs_) const;
126
135 virtual bool operator!=(const Color& rhs_) const;
136
144 static Color red();
145
153 static Color orange();
154
162 static Color yellow();
163
171 static Color green();
172
180 static Color cyan();
181
189 static Color blue();
190
198 static Color purple();
199
207 static Color magenta();
208
216 static Color white();
217
225 static Color lightGray();
226
234 static Color gray();
235
243 static Color darkGray();
244
252 static Color black();
253
254
255 private:
256 #if defined(HDI_CORE_AIP_MODE)
257 friend aip::Color* __accessImpl(const Color&);
258 friend Color __accessCtor(const aip::Color&);
259
263 aip::Color* __impl;
264
270 Color(const aip::Color&);
271 #elif defined(HDI_CORE_PSP_MODE)
272 friend psp::Color* __accessImpl(const Color&);
273 friend Color __accessCtor(const psp::Color&);
274
278 psp::Color* __impl;
279
285 Color(const psp::Color&);
286 #endif
287
288 };
289
290 typedef std::unique_ptr<Color> ColorUP;
291 typedef std::shared_ptr<Color> ColorSP;
292 typedef std::weak_ptr<Color> ColorWP;
293
294 #if defined(HDI_CORE_AIP_MODE)
295 extern aip::Color* __accessImpl(const Color&);
296 extern Color __accessCtor(const aip::Color&);
297 #elif defined(HDI_CORE_PSP_MODE)
298 extern psp::Color* __accessImpl(const Color&);
299 extern Color __accessCtor(const psp::Color&);
300 #endif
301 }
302}
303
304#endif
305// __HDI_CORE_COLOR__
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:32
static Color black()
Static accessor to get a pure black Color object.
static Color purple()
Static accessor to get a pure purple Color object.
double g
Green channel, in range [0.0, 1.0].
Definition: hdicoreColor.h:42
virtual void lighten(const double percentage_)
Lightens the color by a percentage.
static Color white()
Static accessor to get a pure white Color object.
static Color cyan()
Static accessor to get a pure cyan Color object.
static Color yellow()
Static accessor to get a pure yellow Color object.
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 not the same as another.
static Color red()
Static accessor to get a pure red Color object.
double r
Red channel, in range [0.0, 1.0].
Definition: hdicoreColor.h:37
virtual ~Color()
Color destructor.
Color(const Color &c_)
Color copy constructor.
Color()
Default Color constructor; makes a black and fully opaque color.
static Color magenta()
Static accessor to get a pure magenta Color object.
static Color orange()
Static accessor to get a pure orange Color object.
virtual bool operator==(const Color &rhs_) const
Tests whether a given Color object is the same as another.
static Color darkGray()
Static accessor to get a dark gray Color object.
static Color lightGray()
Static accessor to get a light gray Color object.
Color(const double r_, const double g_, const double b_, const double o_=1.0)
Color constructor, taking an argument for each channel.
static Color gray()
Static accessor to get a neutral gray Color object.
double b
Blue channel, in range [0.0, 1.0].
Definition: hdicoreColor.h:47
virtual void darken(const double percentage_)
Darkens the color by a percentage.
static Color blue()
Static accessor to get a pure blue Color object.
double opacity
Alpha channel, in range [0.0, 1.0].
Definition: hdicoreColor.h:52
static Color green()
Static accessor to get a pure green Color object.