Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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.
 
void ClearAuto ()
 Clear auto flag of the RAttrColor.
 
RColor GetColor () const
 Extract RColor for given attribute.
 
std::string GetHex () const
 Return color as hex string like 00FF00.
 
bool IsAuto () const
 Returns true if color should get auto value when primitive drawing is performed.
 
RAttrColoroperator= (const RColor &col)
 
void SetAuto (bool on=true)
 Set automatic mode for RAttrColor, will be assigned before primitive painted on the canvas.
 
RAttrColorSetColor (const RColor &col)
 Set r/g/b components of color as hex code, default for the color.
 
- Public Member Functions inherited from ROOT::Experimental::RAttrBase
 RAttrBase ()=default
 
virtual ~RAttrBase ()=default
 

Protected Member Functions

void ClearAlpha ()
 Remove color alpha value.
 
void ClearHex ()
 Remove color hex value.
 
void ClearName ()
 Clear color plain SVG name (if any)
 
RAttrMap CollectDefaults () const override
 Provide possible attributes names and values.
 
std::string GetAlphaHex () const
 Returns color alpha (opacity) as hex string like FF.
 
std::string GetName () const
 Returns color as plain SVG name like "white" or "lightblue".
 
bool HasAlpha () const
 Returns true if color alpha (opacity) was specified.
 
bool HasHex () const
 Returns true if color hex value was specified.
 
bool HasName () const
 Returns true if color name was specified.
 
void SetAlpha (float alpha)
 Set color alpha (opacity) value - from 0 to 1.
 
void SetAlphaHex (const std::string &val)
 Set color alpha (opacity) value as hex.
 
void SetHex (const std::string &_hex)
 Set color as hex string like 00FF00.
 
void SetName (const std::string &_name)
 Set color as plain SVG name like "white" or "lightblue".
 
- 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.
 
const Val_t AccessValue (const std::string &name, bool use_style=true) const
 Search value with given name in attributes.
 
void AssignDrawable (RDrawable *drawable, const std::string &prefix)
 Return value from attributes container - no style or defaults are used.
 
void AssignParent (RAttrBase *parent, const std::string &prefix)
 Assign parent object for this RAttrBase.
 
void Clear ()
 Clear all respective values from drawable. Only defaults can be used.
 
void ClearValue (const std::string &name)
 Clear value if any with specified name.
 
void CopyTo (RAttrBase &tgt, bool use_style=true) const
 Copy attributes into target object.
 
bool CopyValue (const std::string &name, const RAttrMap::Value_t &value, bool check_type=true)
 Copy attributes from other object.
 
Rec_t EnsureAttr (const std::string &name)
 Ensure attribute with give name exists - creates container for attributes if required.
 
template<typename RET_TYPE , typename MATCH_TYPE = void>
auto Eval (const std::string &name, bool use_dflts=true) const
 Evaluate attribute value.
 
virtual const RAttrMapGetDefaults () const
 Return default values for attributes, empty for base class.
 
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.
 
virtual bool IsValue () const
 
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.
 
void MoveTo (RAttrBase &tgt)
 Move all fields into target object.
 
RAttrBaseoperator= (const RAttrBase &src)
 
void SetNoValue (const std::string &name)
 Set <NoValue> for attribute.
 
void SetValue (const std::string &name, bool value)
 Set boolean value.
 
void SetValue (const std::string &name, const RPadLength &value)
 Set PadLength value.
 
void SetValue (const std::string &name, const std::string &value)
 Set string value.
 
void SetValue (const std::string &name, double value)
 Set double value.
 
void SetValue (const std::string &name, int value)
 Set integer value.
 

Private Member Functions

 R__ATTR_CLASS (RAttrColor, "color")
 

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 110 of file RAttrColor.hxx.

◆ ClearAlpha()

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

Remove color alpha value.

Definition at line 76 of file RAttrColor.hxx.

◆ ClearAuto()

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

Clear auto flag of the RAttrColor.

Definition at line 129 of file RAttrColor.hxx.

◆ ClearHex()

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

Remove color hex value.

Definition at line 58 of file RAttrColor.hxx.

◆ ClearName()

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

Clear color plain SVG name (if any)

Definition at line 49 of file RAttrColor.hxx.

◆ CollectDefaults()

RAttrMap ROOT::Experimental::RAttrColor::CollectDefaults ( ) const
inlineoverrideprotectedvirtual

Provide possible attributes names and values.

Reimplemented from ROOT::Experimental::RAttrBase.

Definition at line 40 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 64 of file RAttrColor.hxx.

◆ GetColor()

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

Extract RColor for given attribute.

Definition at line 96 of file RAttrColor.hxx.

◆ GetHex()

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

Return color as hex string like 00FF00.

Definition at line 119 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 46 of file RAttrColor.hxx.

◆ HasAlpha()

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

Returns true if color alpha (opacity) was specified.

Definition at line 67 of file RAttrColor.hxx.

◆ HasHex()

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

Returns true if color hex value was specified.

Definition at line 61 of file RAttrColor.hxx.

◆ HasName()

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

Returns true if color name was specified.

Definition at line 52 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 123 of file RAttrColor.hxx.

◆ operator=()

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

Definition at line 135 of file RAttrColor.hxx.

◆ R__ATTR_CLASS()

ROOT::Experimental::RAttrColor::R__ATTR_CLASS ( RAttrColor  ,
"color"   
)
private

◆ SetAlpha()

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

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

Definition at line 70 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 73 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 126 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 80 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 55 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 43 of file RAttrColor.hxx.

Friends And Related Symbol Documentation

◆ operator==

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

Definition at line 132 of file RAttrColor.hxx.

Libraries for ROOT::Experimental::RAttrColor:

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