![]() |
ROOT 6.18/05 Reference Guide |
A color: Red|Green|Blue|Alpha, or a position in a RPalette.
Definition at line 28 of file RColor.hxx.
Classes | |
struct | Alpha |
class | AutoTag |
Used to signal that this color shall be automatically chosen by the drawing routines, by picking a color from the RPad 's (or rather its RFrame 's) current RPalette . More... | |
Public Types | |
enum class | EKind { kRGBA , kPalettePos , kAuto } |
using | RGBA = std::array< float, 4 > |
Public Member Functions | |
constexpr | RColor ()=default |
constexpr | RColor (AutoTag) |
Constructs an automatically assigned color. Call as RColor col(RColor::kAuto) . More... | |
constexpr | RColor (const RGBA &rgba) |
Initialize a RColor with red, green, blue and alpha component as an array. More... | |
constexpr | RColor (float paletteOrdinal) |
Initialize a RColor with a RPalette ordinal. More... | |
constexpr | RColor (float r, float g, float b, Alpha alpha=kOpaque) |
Initialize a RColor with red, green, blue and alpha component. More... | |
constexpr | RColor (float r, float g, float b, float alpha) |
Initialize a RColor with red, green, blue and alpha component. More... | |
float | GetAlpha () const |
For RGBA or auto colors, get the alpha component (0..1). More... | |
float | GetBlue () const |
For RGBA or auto colors, get the blue component (0..1). More... | |
float | GetGreen () const |
For RGBA or auto colors, get the green component (0..1). More... | |
void | GetHLS (float &hue, float &light, float &satur) |
Return the Hue, Light, Saturation (HLS) definition of this RColor. More... | |
float | GetPaletteOrdinal () const |
If this is an ordinal in a palette, resolve the. More... | |
float | GetRed () const |
For RGBA or auto colors, get the red component (0..1). More... | |
bool | IsAuto () const |
Determine whether this RColor will be assigned a actual color upon drawing. More... | |
bool | IsPaletteOrdinal () const |
Determine whether this RColor is storing an ordinal of a RPalette (in contrast to RGBA). More... | |
bool | IsRGBA () const |
Determine whether this RColor is storing RGBA (in contrast to an ordinal of a RPalette). More... | |
void | SetAlpha (Alpha a) |
For RGBA or auto colors, set the alpha component. More... | |
void | SetAlpha (float a) |
For RGBA or auto colors, set the alpha component. More... | |
void | SetBlue (float b) |
For RGBA or auto colors, set the blue component. More... | |
void | SetGreen (float g) |
For RGBA or auto colors, set the green component. More... | |
void | SetRed (float r) |
For RGBA or auto colors, set the red component. More... | |
void | SetRGBFromHLS (float hue, float light, float satur) |
Set the Red Green and Blue (RGB) values from the Hue, Light, Saturation (HLS). More... | |
Static Public Attributes | |
static constexpr Alpha | kOpaque {1.} |
An opaque color. More... | |
static constexpr Alpha | kTransparent {0.} |
A completely transparent color. More... | |
Default colors | |
static constexpr RGBA | kRed {{1., 0., 0., 1.}} |
static constexpr RGBA | kGreen {{0., 1., 0., 1.}} |
static constexpr RGBA | kBlue {{0., 0, 1., 1.}} |
static constexpr RGBA | kWhite {{1., 1, 1., 1.}} |
static constexpr RGBA | kBlack {{0., 0., 0., 1.}} |
static constexpr RGBA | kInvisible {{0., 0., 0., 0.}} |
static constexpr AutoTag | kAuto {} |
Private Member Functions | |
bool | AssertNotPalettePos () const |
throw an exception if the color isn't specified as kRGBA or kAuto , the two cases where asking for RBGA members makes sense. More... | |
Private Attributes | |
float | fAlpha = 1. |
The "A" in RGBA (0 <= A <= 1). More... | |
float | fBlue = 0. |
The "B" in RGBA (0 <= B <= 1). Unused if fKind != kRGBA . More... | |
float | fGreen = 0. |
The "G" in RGBA (0 <= G <= 1). Unused if fKind != kRGBA . More... | |
EKind | fKind = EKind::kRGBA |
How the color is defined. More... | |
float | fRedOrPalettePos = 0. |
The "R" in RGBA (0 <= R <= 1), or the palette pos if fKind is kPalettePos . More... | |
Friends | |
bool | operator== (const RColor &lhs, const RColor &rhs) |
#include <ROOT/RColor.hxx>
using ROOT::Experimental::RColor::RGBA = std::array<float, 4> |
Definition at line 71 of file RColor.hxx.
|
strong |
Enumerator | |
---|---|
kRGBA | The color is defined as specific RGBA values. |
kPalettePos | |
kAuto | The color will be set upon drawing the canvas choosing a |
Definition at line 42 of file RColor.hxx.
|
constexprdefault |
|
inlineconstexpr |
Initialize a RColor with red, green, blue and alpha component.
Definition at line 77 of file RColor.hxx.
|
inlineconstexpr |
Initialize a RColor with red, green, blue and alpha component.
Definition at line 80 of file RColor.hxx.
|
inlineconstexpr |
Initialize a RColor with red, green, blue and alpha component as an array.
Definition at line 83 of file RColor.hxx.
|
inlineconstexpr |
|
inlineconstexpr |
Constructs an automatically assigned color. Call as RColor col(RColor::kAuto)
.
Definition at line 96 of file RColor.hxx.
|
private |
throw an exception if the color isn't specified as kRGBA
or kAuto
, the two cases where asking for RBGA members makes sense.
Definition at line 49 of file RColor.cxx.
|
inline |
For RGBA or auto colors, get the alpha component (0..1).
Definition at line 148 of file RColor.hxx.
|
inline |
For RGBA or auto colors, get the blue component (0..1).
Definition at line 141 of file RColor.hxx.
|
inline |
For RGBA or auto colors, get the green component (0..1).
Definition at line 134 of file RColor.hxx.
|
inline |
Return the Hue, Light, Saturation (HLS) definition of this RColor.
Definition at line 185 of file RColor.hxx.
float RColor::GetPaletteOrdinal | ( | ) | const |
If this is an ordinal in a palette, resolve the.
Definition at line 42 of file RColor.cxx.
|
inline |
For RGBA or auto colors, get the red component (0..1).
Definition at line 127 of file RColor.hxx.
|
inline |
Determine whether this RColor
will be assigned a actual color upon drawing.
Definition at line 105 of file RColor.hxx.
|
inline |
Determine whether this RColor
is storing an ordinal of a RPalette (in contrast to RGBA).
Definition at line 102 of file RColor.hxx.
|
inline |
Determine whether this RColor is storing RGBA (in contrast to an ordinal of a RPalette).
Definition at line 99 of file RColor.hxx.
For RGBA or auto colors, set the alpha component.
Definition at line 179 of file RColor.hxx.
|
inline |
For RGBA or auto colors, set the alpha component.
Definition at line 173 of file RColor.hxx.
|
inline |
For RGBA or auto colors, set the blue component.
Definition at line 167 of file RColor.hxx.
|
inline |
For RGBA or auto colors, set the green component.
Definition at line 161 of file RColor.hxx.
|
inline |
For RGBA or auto colors, set the red component.
Definition at line 155 of file RColor.hxx.
|
inline |
Set the Red Green and Blue (RGB) values from the Hue, Light, Saturation (HLS).
Definition at line 223 of file RColor.hxx.
Definition at line 110 of file RColor.hxx.
|
private |
The "A" in RGBA (0 <= A <= 1).
Unused if fKind != kRGBA
. fAlpha == 0
means so transparent it's invisible, fAlpha == 1
means completely opaque.
Definition at line 61 of file RColor.hxx.
|
private |
The "B" in RGBA (0 <= B <= 1). Unused if fKind != kRGBA
.
Definition at line 57 of file RColor.hxx.
|
private |
The "G" in RGBA (0 <= G <= 1). Unused if fKind != kRGBA
.
Definition at line 54 of file RColor.hxx.
|
private |
How the color is defined.
Definition at line 64 of file RColor.hxx.
|
private |
The "R" in RGBA (0 <= R <= 1), or the palette pos if fKind is kPalettePos
.
Definition at line 51 of file RColor.hxx.
|
staticconstexpr |
Definition at line 260 of file RColor.hxx.
|
staticconstexpr |
Definition at line 258 of file RColor.hxx.
|
staticconstexpr |
Definition at line 256 of file RColor.hxx.
|
staticconstexpr |
Definition at line 255 of file RColor.hxx.
|
staticconstexpr |
Definition at line 259 of file RColor.hxx.
|
staticconstexpr |
An opaque color.
Definition at line 38 of file RColor.hxx.
|
staticconstexpr |
Definition at line 254 of file RColor.hxx.
|
staticconstexpr |
A completely transparent color.
Definition at line 40 of file RColor.hxx.
|
staticconstexpr |
Definition at line 257 of file RColor.hxx.