9#ifndef ROOT7_RAttrColor
10#define ROOT7_RAttrColor
19namespace Experimental {
36 AddString(
"rgb",
"").AddString(
"a",
"").AddString(
"name",
"").AddBool(
"auto",
false));
44 std::string
GetName()
const {
return GetValue<std::string>(
"name"); }
62 std::string
GetAlphaHex()
const {
return GetValue<std::string>(
"a"); }
118 std::string
GetHex()
const {
return GetValue<std::string>(
"rgb"); }
122 bool IsAuto()
const {
return GetValue<bool>(
"auto"); }
Base class for all attributes, used with RDrawable.
bool HasValue(const std::string &name, bool check_defaults=false) const
void ClearValue(const std::string &name)
Clear value if any with specified name.
void SetValue(const std::string &name, bool value)
Set boolean value.
Access RColor from drawable attributes.
void SetName(const std::string &_name)
Set color as plain SVG name like "white" or "lightblue".
RAttrColor & SetColor(const RColor &col)
Set r/g/b components of color as hex code, default for the color.
void SetHex(const std::string &_hex)
Set color as hex string like 00FF00.
void ClearName()
Clear color plain SVG name (if any)
bool IsAuto() const
Returns true if color should get auto value when primitive drawing is performed.
friend bool operator==(const RAttrColor &lhs, const RAttrColor &rhs)
void SetAlphaHex(const std::string &val)
Set color alpha (opacity) value as hex.
std::string GetHex() const
Return color as hex string like 00FF00.
void SetAlpha(float alpha)
Set color alpha (opacity) value - from 0 to 1.
void ClearHex()
Remove color hex value.
bool HasAlpha() const
Returns true if color alpha (opacity) was specified.
RColor GetColor() const
Extract RColor for given attribute.
void SetAuto(bool on=true)
Set automatic mode for RAttrColor, will be assigned before primitive painted on the canvas.
R__ATTR_CLASS(RAttrColor, "color_", AddString("rgb", "").AddString("a", "").AddString("name", "").AddBool("auto", false))
RAttrColor & operator=(const RColor &col)
std::string GetAlphaHex() const
Returns color alpha (opacity) as hex string like FF.
void Clear()
Remove all values which can correspond to RColor value.
std::string GetName() const
Returns color as plain SVG name like "white" or "lightblue".
void ClearAlpha()
Remove color alpha value.
bool HasName() const
Returns true if color name was specified.
void ClearAuto()
Clear auto flag of the RAttrColor.
bool HasHex() const
Returns true if color hex value was specified.
const std::string & GetName() const
Returns color as plain SVG name like "white" or "lightblue".
bool SetRGBHex(const std::string &hex)
Set RGB values as hex.
bool SetAlphaHex(const std::string &hex)
Set Alpha value as hex.
RColor & SetName(const std::string &name)
Set color as plain SVG name like "white" or "lightblue".
static std::string toHex(uint8_t v)
Converts integer from 0 to 255 into hex format with two digits like 00.
const std::vector< uint8_t > & GetRGBA() const
Returns color as RGBA array - when exists.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...