96 inline static SP::CORE_Color
New(
const tUInt& rgb){
102 inline static SP::CORE_Color
New(){
123 return New(getDefaultColorString(variing));
129 return NewDefaultColor(
false);
135 return New(getDefaultColorString(index,
163 inline void setCyan() { setColor(
"#00ffff");};
169 inline void setPink() { setColor(
"#FD6C9E");};
178 return (x->getRGB()==getRGB());
191 void setColor(
const SPC::CORE_Color& c);
196 if (c!=
null) setColor(*c);
211 void setColor(
const tString& c);
218 void setColor(
const SPC::CORE_Color& c0,
const SPC::CORE_Color& c1,
const tFloat& f);
238 mValue = 0xff000000 | rgb;
246 const SPC::CORE_Color& fromColor,
247 const SP::CORE_Color& color)
const {
248 toColor(tau,*fromColor.get(),*color.get());
255 void toColor(
const tFloat& tau,
273 tString c=DEFAULT_COLORS[DEFAULT_COLOR_INDEX];
275 DEFAULT_COLOR_INDEX=(DEFAULT_COLOR_INDEX+1)%DEFAULT_COLORS_NUMBER;
284 return getDefaultColorString(index,
false);
294 DEFAULT_COLOR_INDEX=index%DEFAULT_COLORS_NUMBER;
295 return getDefaultColorString(variing);
302 return getDefaultColorString(
false);
349 r=((double)getRed())/((
double)255.0);
350 b=((double)getBlue())/((
double)255.0);
351 g=((double)getGreen())/((
double) 255.0);
373 opacity=getOpacity();
394 void darker(
const SP::CORE_Color& color)
const;
409 void brighter(
const SP::CORE_Color& color)
const;
414 return toString(
"color[r,g,b,a]");
421 return toString(
"color[r,g,b]");
428 string toString(
const tString& format)
const;
void setOpacity(const tUChar &opacity)
set the opacity in [0,100]
Definition: CORE_Color.h:186
void setColor(const CORE_Color &c)
set the color to color
Definition: CORE_Color.h:201
void setCyan()
set color to Cyan
Definition: CORE_Color.h:163
string name() const
return the string representation of the color
Definition: CORE_Color.h:413
tUChar getRed() const
Returns the red component in the range 0-255 in the default sRGB space.
Definition: CORE_Color.cpp:71
static SP::CORE_Color NewDefaultColor(const tBoolean &variing)
create a new default color
Definition: CORE_Color.h:122
virtual string toString() const
return the string representation of the color
Definition: CORE_Color.h:420
#define DEFINE_SPTR(X)
Definition: CORE_Pointers.h:191
const tUInt & getRGB() const
Returns the RGB value representing the color in the default sRGB (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).
Definition: CORE_Color.h:339
static SP::CORE_Color New(const tUChar &r, const tUChar &g, const tUChar &b, const tUChar &a)
create a color with rgb value in the a base
Definition: CORE_Color.h:90
static tString getDefaultColorString()
Definition: CORE_Color.h:301
void setOrange()
set color to orange ff6c00
Definition: CORE_Color.h:157
void getRGBColor(tUChar &r, tUChar &g, tUChar &b) const
get the rgdb color
Definition: CORE_Color.h:358
void setPink()
set color to Pink
Definition: CORE_Color.h:169
tUInt mValue
Definition: CORE_Color.h:44
void getRGBColor(double &r, double &g, double &b) const
get the rgdb color
Definition: CORE_Color.h:348
static SP::CORE_Color New(const tUInt &rgb)
create a color with rgb value
Definition: CORE_Color.h:96
void setGreen()
set color to green 00ff00
Definition: CORE_Color.h:151
void setRGB(const tUInt &rgb)
set rgb
Definition: CORE_Color.h:237
#define tFloat
Definition: types.h:50
void setBlack()
set color to black 000000
Definition: CORE_Color.h:142
static SP::CORE_Color NewDefaultColor()
create a new default color
Definition: CORE_Color.h:128
#define tBoolean
Definition: types.h:139
void setRed()
set color to red ff0000
Definition: CORE_Color.h:148
static const tFlag DEFAULT_COLORS_NUMBER
Definition: CORE_Color.h:39
tUChar mOpacity
Definition: CORE_Color.h:47
#define null
Definition: types.h:144
static tFloat FACTOR
Definition: CORE_Color.h:50
static SP::CORE_Color New()
create a color
Definition: CORE_Color.h:102
void setWhite()
set color to white ffffff
Definition: CORE_Color.h:145
#define SP_OBJECT(X)
Definition: CORE_Pointers.h:203
static tFlag DEFAULT_COLOR_INDEX
Definition: CORE_Color.h:41
static tString getDefaultColorString(const tFlag &index)
Definition: CORE_Color.h:283
static SP::CORE_Color New(const tString &value)
create a color
Definition: CORE_Color.h:109
void setPurple()
set color to Purple
Definition: CORE_Color.h:166
const tUChar & getOpacity() const
get opacity
Definition: CORE_Color.h:265
void getRGBColor(tUChar &r, tUChar &g, tUChar &b, tUChar &opacity) const
get the rgdb color
Definition: CORE_Color.h:369
#define tUChar
Definition: types.h:20
#define tUInt
Definition: types.h:33
void setColor(const CORE_Color *c)
set the color to color
Definition: CORE_Color.h:205
tUChar getGreen() const
Returns the green component in the range 0-255 in the default sRGB space.
Definition: CORE_Color.cpp:76
static SP::CORE_Color New(const tUChar &r, const tUChar &g, const tUChar &b)
create a color with rgb value
Definition: CORE_Color.h:83
static SP::CORE_Color NewDefaultColor(const tFlag &index, const tBoolean &variing)
create a new default color
Definition: CORE_Color.h:133
static tString getDefaultColorString(const tBoolean &variing)
get default color string
Definition: CORE_Color.h:272
abstract base class for most classes.
Definition: CORE_Object.h:53
#define tString
Definition: types.h:135
this class describes color
Definition: CORE_Color.h:28
void setColor(const tFloat &r, const tFloat &g, const tFloat &b)
set color
Definition: CORE_Color.h:230
void setBlue()
set color to blue 0000ff
Definition: CORE_Color.h:154
static SP::CORE_Color New(const CORE_Color &c)
copy a color
Definition: CORE_Color.h:115
void setColor(const SPC::CORE_Color *c)
set the color to color
Definition: CORE_Color.h:195
static tString getDefaultColorString(const tFlag &index, const tBoolean &variing)
Definition: CORE_Color.h:292
void toColor(const tFloat &tau, const SPC::CORE_Color &fromColor, const SP::CORE_Color &color) const
set the color as an intermediare between from color and this color
Definition: CORE_Color.h:245
void setYellow()
set color to yellow
Definition: CORE_Color.h:160
tBoolean isEquals(const SPC::CORE_Color &x)
test if This & x color are identical
Definition: CORE_Color.h:177
tUChar getBlue() const
Returns the blue component in the range 0-255 in the default sRGB space.
Definition: CORE_Color.cpp:81
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141
#define tFlag
Definition: types.h:74