Logo ROOT  
Reference Guide
ROOT::Experimental::RAttrColor Class Reference

Access RColor from drawable attributes.

Author
Sergey Linev S.Lin.nosp@m.ev@g.nosp@m.si.de
Date
2020-03-09
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!

Definition at line 33 of file RAttrColor.hxx.

Public Member Functions

void Clear ()
 Remove all values which can correspond to RColor value. More...
 
void ClearAuto ()
 Clear auto flag of the RAttrColor. More...
 
RColor GetColor () const
 Extract RColor for given attribute. More...
 
std::string GetHex () const
 Return color as hex string like 00FF00. More...
 
bool IsAuto () const
 Returns true if color should get auto value when primitive drawing is performed. More...
 
RAttrColoroperator= (const RColor &col)
 
void SetAuto (bool on=true)
 Set automatic mode for RAttrColor, will be assigned before primitive painted on the canvas. More...
 
RAttrColorSetColor (const RColor &col)
 Set r/g/b components of color as hex code, default for the color. More...
 
- Public Member Functions inherited from ROOT::Experimental::RAttrBase
 RAttrBase ()=default
 
virtual ~RAttrBase ()=default
 

Protected Member Functions

void ClearAlpha ()
 Remove color alpha value. More...
 
void ClearHex ()
 Remove color hex value. More...
 
void ClearName ()
 Clear color plain SVG name (if any) More...
 
std::string GetAlphaHex () const
 Returns color alpha (opacity) as hex string like FF. More...
 
std::string GetName () const
 Returns color as plain SVG name like "white" or "lightblue". More...
 
bool HasAlpha () const
 Returns true if color alpha (opacity) was specified. More...
 
bool HasHex () const
 Returns true if color hex value was specified. More...
 
bool HasName () const
 Returns true if color name was specified. More...
 
void SetAlpha (float alpha)
 Set color alpha (opacity) value - from 0 to 1. More...
 
void SetAlphaHex (const std::string &val)
 Set color alpha (opacity) value as hex. More...
 
void SetHex (const std::string &_hex)
 Set color as hex string like 00FF00. More...
 
void SetName (const std::string &_name)
 Set color as plain SVG name like "white" or "lightblue". More...
 
- Protected Member Functions inherited from ROOT::Experimental::RAttrBase
 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
 Search value with given name in attributes. More...
 
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)
 Assign parent object for this RAttrBase. More...
 
void Clear ()
 Clear all respective values from drawable. Only defaults can be used. More...
 
void ClearValue (const std::string &name)
 Clear value if any with specified name. More...
 
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 RAttrMapGetDefaults () const
 Return default values for attributes, empty for base class. More...
 
const std::string & GetPrefix () const
 
template<typename 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
 Check if provided value equal to attribute in the map. More...
 
void MoveTo (RAttrBase &tgt)
 Move all fields into target object. More...
 
RAttrBaseoperator= (const RAttrBase &src)
 
void SetNoValue (const std::string &name)
 Set <NoValue> for attribute. More...
 
void SetValue (const std::string &name, bool value)
 Set boolean value. More...
 
void SetValue (const std::string &name, const RPadLength &value)
 Set PadLength value. More...
 
void SetValue (const std::string &name, const std::string &value)
 Set string value. More...
 
void SetValue (const std::string &name, double value)
 Set double value. More...
 
void SetValue (const std::string &name, int value)
 Set integer value. More...
 

Private Member Functions

 R__ATTR_CLASS (RAttrColor, "color_", AddString("rgb", "").AddString("a", "").AddString("name", "").AddBool("auto", false))
 

Friends

bool operator== (const RAttrColor &lhs, const RAttrColor &rhs)
 

#include <ROOT/RAttrColor.hxx>

Inheritance diagram for ROOT::Experimental::RAttrColor:
[legend]

Member Function Documentation

◆ Clear()

void ROOT::Experimental::RAttrColor::Clear ( )
inline

Remove all values which can correspond to RColor value.

Definition at line 109 of file RAttrColor.hxx.

◆ ClearAlpha()

void ROOT::Experimental::RAttrColor::ClearAlpha ( )
inlineprotected

Remove color alpha value.

Definition at line 74 of file RAttrColor.hxx.

◆ ClearAuto()

void ROOT::Experimental::RAttrColor::ClearAuto ( )
inline

Clear auto flag of the RAttrColor.

Definition at line 128 of file RAttrColor.hxx.

◆ ClearHex()

void ROOT::Experimental::RAttrColor::ClearHex ( )
inlineprotected

Remove color hex value.

Definition at line 56 of file RAttrColor.hxx.

◆ ClearName()

void ROOT::Experimental::RAttrColor::ClearName ( )
inlineprotected

Clear color plain SVG name (if any)

Definition at line 47 of file RAttrColor.hxx.

◆ GetAlphaHex()

std::string ROOT::Experimental::RAttrColor::GetAlphaHex ( ) const
inlineprotected

Returns color alpha (opacity) as hex string like FF.

Default is empty

Definition at line 62 of file RAttrColor.hxx.

◆ GetColor()

RColor ROOT::Experimental::RAttrColor::GetColor ( ) const
inline

Extract RColor for given attribute.

Definition at line 95 of file RAttrColor.hxx.

◆ GetHex()

std::string ROOT::Experimental::RAttrColor::GetHex ( ) const
inline

Return color as hex string like 00FF00.

Definition at line 118 of file RAttrColor.hxx.

◆ GetName()

std::string ROOT::Experimental::RAttrColor::GetName ( ) const
inlineprotected

Returns color as plain SVG name like "white" or "lightblue".

Definition at line 44 of file RAttrColor.hxx.

◆ HasAlpha()

bool ROOT::Experimental::RAttrColor::HasAlpha ( ) const
inlineprotected

Returns true if color alpha (opacity) was specified.

Definition at line 65 of file RAttrColor.hxx.

◆ HasHex()

bool ROOT::Experimental::RAttrColor::HasHex ( ) const
inlineprotected

Returns true if color hex value was specified.

Definition at line 59 of file RAttrColor.hxx.

◆ HasName()

bool ROOT::Experimental::RAttrColor::HasName ( ) const
inlineprotected

Returns true if color name was specified.

Definition at line 50 of file RAttrColor.hxx.

◆ IsAuto()

bool ROOT::Experimental::RAttrColor::IsAuto ( ) const
inline

Returns true if color should get auto value when primitive drawing is performed.

Definition at line 122 of file RAttrColor.hxx.

◆ operator=()

RAttrColor & ROOT::Experimental::RAttrColor::operator= ( const RColor col)
inline

Definition at line 134 of file RAttrColor.hxx.

◆ R__ATTR_CLASS()

ROOT::Experimental::RAttrColor::R__ATTR_CLASS ( RAttrColor  ,
"color_"  ,
AddString("rgb", "").AddString("a", "").AddString("name", "").AddBool("auto", false)   
)
private

◆ SetAlpha()

void ROOT::Experimental::RAttrColor::SetAlpha ( float  alpha)
inlineprotected

Set color alpha (opacity) value - from 0 to 1.

Definition at line 68 of file RAttrColor.hxx.

◆ SetAlphaHex()

void ROOT::Experimental::RAttrColor::SetAlphaHex ( const std::string &  val)
inlineprotected

Set color alpha (opacity) value as hex.

Definition at line 71 of file RAttrColor.hxx.

◆ SetAuto()

void ROOT::Experimental::RAttrColor::SetAuto ( bool  on = true)
inline

Set automatic mode for RAttrColor, will be assigned before primitive painted on the canvas.

Definition at line 125 of file RAttrColor.hxx.

◆ SetColor()

RAttrColor & ROOT::Experimental::RAttrColor::SetColor ( const RColor col)
inline

Set r/g/b components of color as hex code, default for the color.

Definition at line 78 of file RAttrColor.hxx.

◆ SetHex()

void ROOT::Experimental::RAttrColor::SetHex ( const std::string &  _hex)
inlineprotected

Set color as hex string like 00FF00.

Definition at line 53 of file RAttrColor.hxx.

◆ SetName()

void ROOT::Experimental::RAttrColor::SetName ( const std::string &  _name)
inlineprotected

Set color as plain SVG name like "white" or "lightblue".

Clears RGB component before

Definition at line 41 of file RAttrColor.hxx.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const RAttrColor lhs,
const RAttrColor rhs 
)
friend

Definition at line 131 of file RAttrColor.hxx.

Libraries for ROOT::Experimental::RAttrColor:
[legend]

The documentation for this class was generated from the following file: