ROOT 6.12/07 Reference Guide |
A color: Red|Green|Blue|Alpha, or a position in a TPalette.
Definition at line 27 of file TColor.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 TPad 's (or rather its TFrame 's) current TPalette . More... | |
class | TAlpha |
The alpha value of a color: 0 is completely transparent, 1 is completely opaque. More... | |
Public Types | |
enum | EKind { EKind::kRGBA, EKind::kPalettePos, EKind::kAuto } |
using | PredefinedRGB = std::array< float, 3 > |
Public Member Functions | |
constexpr | TColor ()=default |
constexpr | TColor (float r, float g, float b, float alpha) |
Initialize a TColor with red, green, blue and alpha component. More... | |
constexpr | TColor (float r, float g, float b, Alpha alpha=kOpaque) |
Initialize a TColor with red, green, blue and alpha component. More... | |
constexpr | TColor (const PredefinedRGB &predef) |
Initialize a TColor with red, green, blue and alpha component. More... | |
constexpr | TColor (float paletteOrdinal) |
Initialize a TColor with a TPalette ordinal. More... | |
constexpr | TColor (AutoTag) |
Constructs an automatically assigned color. Call as TColor col(TColor::kAuto) . 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... | |
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 TColor will be assigned a actual color upon drawing. More... | |
bool | IsPaletteOrdinal () const |
Determine whether this TColor is storing an ordinal of a TPalette (in contrast to RGBA). More... | |
bool | IsRGBA () const |
Determine whether this TColor is storing RGBA (in contrast to an ordinal of a TPalette). More... | |
void | SetAlpha (float a) |
For RGBA or auto colors, set the alpha component. More... | |
void | SetAlpha (Alpha 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... | |
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 PredefinedRGB | kRed {{1., 0., 0.}} |
static constexpr PredefinedRGB | kGreen {{0., 1., 0.}} |
static constexpr PredefinedRGB | kBlue {{0., 0, 1.}} |
static constexpr PredefinedRGB | kWhite {{1., 1, 1.}} |
static constexpr PredefinedRGB | kBlack {{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 TColor &lhs, const TColor &rhs) |
#include <ROOT/TColor.hxx>
using ROOT::Experimental::TColor::PredefinedRGB = std::array<float, 3> |
Definition at line 70 of file TColor.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 41 of file TColor.hxx.
|
default |
|
inline |
Initialize a TColor with red, green, blue and alpha component.
Definition at line 76 of file TColor.hxx.
|
inline |
Initialize a TColor with red, green, blue and alpha component.
Definition at line 79 of file TColor.hxx.
|
inline |
Initialize a TColor with red, green, blue and alpha component.
Definition at line 82 of file TColor.hxx.
|
inline |
|
inline |
Constructs an automatically assigned color. Call as TColor col(TColor::kAuto)
.
Definition at line 95 of file TColor.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 40 of file TColor.cxx.
|
inline |
For RGBA or auto colors, get the alpha component (0..1).
Definition at line 147 of file TColor.hxx.
|
inline |
For RGBA or auto colors, get the blue component (0..1).
Definition at line 140 of file TColor.hxx.
|
inline |
For RGBA or auto colors, get the green component (0..1).
Definition at line 133 of file TColor.hxx.
float TColor::GetPaletteOrdinal | ( | ) | const |
If this is an ordinal in a palette, resolve the.
Definition at line 33 of file TColor.cxx.
|
inline |
For RGBA or auto colors, get the red component (0..1).
Definition at line 126 of file TColor.hxx.
|
inline |
Determine whether this TColor
will be assigned a actual color upon drawing.
Definition at line 104 of file TColor.hxx.
|
inline |
Determine whether this TColor
is storing an ordinal of a TPalette (in contrast to RGBA).
Definition at line 101 of file TColor.hxx.
|
inline |
Determine whether this TColor is storing RGBA (in contrast to an ordinal of a TPalette).
Definition at line 98 of file TColor.hxx.
|
inline |
For RGBA or auto colors, set the alpha component.
Definition at line 172 of file TColor.hxx.
For RGBA or auto colors, set the alpha component.
Definition at line 178 of file TColor.hxx.
|
inline |
For RGBA or auto colors, set the blue component.
Definition at line 166 of file TColor.hxx.
|
inline |
For RGBA or auto colors, set the green component.
Definition at line 160 of file TColor.hxx.
|
inline |
For RGBA or auto colors, set the red component.
Definition at line 154 of file TColor.hxx.
Definition at line 109 of file TColor.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 60 of file TColor.hxx.
|
private |
The "B" in RGBA (0 <= B <= 1). Unused if fKind != kRGBA
.
Definition at line 56 of file TColor.hxx.
|
private |
The "G" in RGBA (0 <= G <= 1). Unused if fKind != kRGBA
.
Definition at line 53 of file TColor.hxx.
|
private |
How the color is defined.
Definition at line 63 of file TColor.hxx.
|
private |
The "R" in RGBA (0 <= R <= 1), or the palette pos if fKind is kPalettePos
.
Definition at line 50 of file TColor.hxx.
|
static |
Definition at line 190 of file TColor.hxx.
|
static |
Definition at line 189 of file TColor.hxx.
|
static |
Definition at line 187 of file TColor.hxx.
|
static |
Definition at line 186 of file TColor.hxx.
|
static |
An opaque color.
Definition at line 37 of file TColor.hxx.
|
static |
Definition at line 185 of file TColor.hxx.
|
static |
A completely transparent color.
Definition at line 39 of file TColor.hxx.
|
static |
Definition at line 188 of file TColor.hxx.