The color class.
- Author
- Axel Naumann axel@.nosp@m.cern.nosp@m..ch
-
Sergey Linev S.Lin.nosp@m.ev@g.nosp@m.si.de
- Date
- 2017-09-26
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
Definition at line 32 of file RColor.hxx.
|
| RColor (const RGB_t &rgb) |
| Construct color with provided RGB_t value. More...
|
|
| RColor (int r, int g, int b) |
| Construct color with provided r,g,b values. More...
|
|
| RColor (int r, int g, int b, float alpha) |
| Construct color with provided r,g,b and alpha values. More...
|
|
std::string | AsSVG () const |
| Returns color value as it will be used in SVG drawing It either include hex format #66FF66 or just plain SVG name. More...
|
|
void | Clear () |
|
void | ClearAlpha () |
| Clear alpha value of the color. More...
|
|
void | ClearAuto () |
| Clear auto flag of the RColor. More...
|
|
void | ClearName () |
| Clear color plain SVG name (if any) More...
|
|
void | ClearRGB () |
| Clear RGB color value (if any) More...
|
|
float | GetAlpha () const |
| Returns color alpha (opacity) as float from 0. More...
|
|
std::string | GetAlphaHex () const |
| Returns color alpha (opacity) as hex string like FF. More...
|
|
int | GetBlue () const |
| Returns blue color component 0..255. More...
|
|
int | GetGreen () const |
| Returns green color component 0..255. More...
|
|
std::string | GetHex () const |
| Return color as hex string like 00FF00. More...
|
|
bool | GetHLS (float &hue, float &light, float &satur) const |
| Return the Hue, Light, Saturation (HLS) definition of this RColor. More...
|
|
std::string | GetName () const |
| Returns color as plain SVG name like "white" or "lightblue". More...
|
|
int | GetRed () const |
| Returns red color component 0..255. More...
|
|
bool | GetRGB (int &r, int &g, int &b) const |
| Decodes hex color value into RGB - each color component as integer from 0 to 255 If color was not specified as hex, method returns false. More...
|
|
bool | HasAlpha () const |
| Returns true if color alpha (opacity) was specified. More...
|
|
bool | IsAuto () const |
| Returns true if color should get auto value when primitive drawing is performed. More...
|
|
RColor & | SetAlpha (float _alpha) |
| Set color alpha (opacity) value - from 0 to 1. More...
|
|
RColor & | SetAlphaHex (const std::string &_alfa) |
| Set color alpha (opacity) value as hex string. More...
|
|
RColor & | SetAuto (bool on=true) |
| Set automatic mode for RColor, will be assigned before primitive painted on the canvas. More...
|
|
RColor & | SetHex (const std::string &_hex) |
| Set color as hex string like 00FF00. More...
|
|
RColor & | SetHLS (float hue, float light, float satur) |
| Set the Red Green and Blue (RGB) values from the Hue, Light, Saturation (HLS). More...
|
|
RColor & | SetName (const std::string &_name) |
| Set color as plain SVG name like "white" or "lightblue". More...
|
|
RColor & | SetRGB (const RGB_t &rgb) |
| Set r/g/b/ components of color as hex code, default for the color. More...
|
|
RColor & | SetRGB (int r, int g, int b) |
| Set r/g/b/ components of color as hex code, default for the color. More...
|
|
| RAttrBase ()=default |
|
virtual | ~RAttrBase ()=default |
|
|
int | GetColorComponent (int indx) const |
| Decodes color component and returns integer from 0 to 255 Values of indx 0: Red, 1: Green, 2: Blue If color was not specified as hex, method returns 0. More...
|
|
bool | GetRGBFloat (float &r, float &g, float &b) const |
| Decodes hex color value into RGB - each color component as float from 0. More...
|
|
| R__ATTR_CLASS (RColor, "color_", AddString("rgb", "").AddString("a", "").AddString("name", "").AddBool("auto", false)) |
|
RColor & | SetRGBFloat (float r, float g, float b) |
| Set RGB values as floats, each from 0..1. More...
|
|
|
| RAttrBase (const RAttrBase &src) |
|
| RAttrBase (RAttrBase *parent, const std::string &prefix) |
|
| RAttrBase (RDrawable *drawable, const std::string &prefix) |
|
const Rec_t | AccessAttr (const std::string &name) const |
| Find attributes container and full-qualified name for value. More...
|
|
const Val_t | AccessValue (const std::string &name, bool use_style=true) const |
|
void | AssignDrawable (RDrawable *drawable, const std::string &prefix) |
| Return value from attributes container - no style or defaults are used. More...
|
|
void | AssignParent (RAttrBase *parent, const std::string &prefix) |
|
void | Clear () |
| Clear all respective values from drawable. More...
|
|
void | ClearValue (const std::string &name) |
|
void | CopyTo (RAttrBase &tgt, bool use_style=true) const |
| Copy attributes into target object. More...
|
|
bool | CopyValue (const std::string &name, const RAttrMap::Value_t &value, bool check_type=true) |
| Copy attributes from other object. More...
|
|
Rec_t | EnsureAttr (const std::string &name) |
| Ensure attribute with give name exists - creates container for attributes if required. More...
|
|
template<typename RET_TYPE , typename MATCH_TYPE = void> |
auto | Eval (const std::string &name, bool use_dflts=true) const |
| Evaluate attribute value. More...
|
|
virtual const RAttrMap & | GetDefaults () const |
| Return default values for attributes, empty for base class. More...
|
|
const std::string & | GetPrefix () const |
|
template<typename T > |
T | GetValue (const std::string &name) const |
|
template<typename T = void> |
bool | HasValue (const std::string &name, bool check_defaults=false) const |
|
bool | IsSame (const RAttrBase &src, bool use_style=true) const |
| Check if all values which are evaluated in this object are exactly the same as in tgt object. More...
|
|
bool | IsValueEqual (const std::string &name, const RAttrMap::Value_t &value, bool use_style=false) const |
| Copy attributes into target object. More...
|
|
RAttrBase & | operator= (const RAttrBase &src) |
|
void | SetValue (const std::string &name, bool value) |
|
void | SetValue (const std::string &name, const std::string &value) |
|
void | SetValue (const std::string &name, double value) |
|
void | SetValue (const std::string &name, int value) |
|
bool RColor::GetHLS |
( |
float & |
hue, |
|
|
float & |
light, |
|
|
float & |
satur |
|
) |
| const |
Return the Hue, Light, Saturation (HLS) definition of this RColor.
Returns the Hue, Light, Saturation (HLS) definition of this RColor If color was not specified as hex, method returns false.
Definition at line 85 of file RColor.cxx.
RColor & RColor::SetHLS |
( |
float |
hue, |
|
|
float |
light, |
|
|
float |
satur |
|
) |
| |
Set the Red Green and Blue (RGB) values from the Hue, Light, Saturation (HLS).
Set the color value from the Hue, Light, Saturation (HLS).
Definition at line 130 of file RColor.cxx.