Hot Door CORE 0.8.4
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreColor.h
Go to the documentation of this file.
1
6
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 {
28 class ArtColor;
29
33 class Color
34 {
35 public:
39 double r;
40
44 double g;
45
49 double b;
50
54 double opacity;
55
62
73 Color(const double r_, const double g_, const double b_, const double o_ = 1.0);
74
82 Color(const Color& c_);
83
94 Color(const ArtColor& c_);
95
101 virtual ~Color();
102
112 virtual Color lighten(const double percentage_) const;
113
123 virtual Color darken(const double percentage_) const;
124
133 virtual Color& operator=(const Color& rhs_);
134
143 virtual bool operator==(const Color& rhs_) const;
144
153 virtual bool operator!=(const Color& rhs_) const;
154
162 static Color red();
163
171 static Color orange();
172
180 static Color yellow();
181
189 static Color green();
190
198 static Color cyan();
199
207 static Color blue();
208
216 static Color purple();
217
225 static Color magenta();
226
234 static Color white();
235
243 static Color lightGray();
244
252 static Color gray();
253
261 static Color darkGray();
262
270 static Color black();
271
279 static Color clear();
280
281
282 private:
283 #if defined(HDI_CORE_AIP_MODE)
284 friend aip::Color* __accessImpl(const Color&);
285 friend Color __accessCtor(const aip::Color&);
286
290 aip::Color* __impl;
291
297 Color(const aip::Color&);
298 #elif defined(HDI_CORE_PSP_MODE)
299 friend psp::Color* __accessImpl(const Color&);
300 friend Color __accessCtor(const psp::Color&);
301
305 psp::Color* __impl;
306
312 Color(const psp::Color&);
313 #endif
314
315 };
316
317 typedef std::unique_ptr<Color> ColorUP;
318 typedef std::shared_ptr<Color> ColorSP;
319 typedef std::weak_ptr<Color> ColorWP;
320
321 #if defined(HDI_CORE_AIP_MODE)
322 extern aip::Color* __accessImpl(const Color&);
323 extern Color __accessCtor(const aip::Color&);
324 #elif defined(HDI_CORE_PSP_MODE)
325 extern psp::Color* __accessImpl(const Color&);
326 extern Color __accessCtor(const psp::Color&);
327 #endif
328 }
329}
330
331#endif
332// __HDI_CORE_COLOR__
Describes the color of art on the artboard.
Definition hdicoreArtColor.h:42
Describes an RGB color, with opacity, typically for UI purposes.
Definition hdicoreColor.h:34
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:44
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.
Color(const ArtColor &c_)
Constructs a Color object from an existing ArtColor 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:39
virtual ~Color()
Color destructor.
Color(const Color &c_)
Color copy constructor.
Color()
Default Color constructor; makes a black and fully opaque color.
static Color clear()
Static accessor to get a Color object with opacity of 0.
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.
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.
double b
Blue channel, in range [0.0, 1.0].
Definition hdicoreColor.h:49
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:54
static Color green()
Static accessor to get a pure green Color object.