22 namespace Experimental {
34 explicit operator float()
const {
return fVal; }
73 constexpr
TColor() =
default;
76 constexpr
TColor(
float r,
float g,
float b,
float alpha): fRedOrPalettePos(r), fGreen(g), fBlue(b), fAlpha(alpha) {}
86 constexpr
TColor(
float paletteOrdinal): fRedOrPalettePos(paletteOrdinal), fKind(
EKind::kPalettePos) {}
156 fRedOrPalettePos =
r;
The color will be set upon drawing the canvas choosing a TPalatte color, see TColor(Auto_t) ...
constexpr TColor(float paletteOrdinal)
Initialize a TColor with a TPalette ordinal.
float GetGreen() const
For RGBA or auto colors, get the green component (0..1).
Namespace for new ROOT classes and functions.
static constexpr PredefinedRGB kGreen
float GetAlpha() const
For RGBA or auto colors, get the alpha component (0..1).
constexpr TColor(float r, float g, float b, float alpha)
Initialize a TColor with red, green, blue and alpha component.
static constexpr Alpha kOpaque
An opaque color.
void SetRed(float r)
For RGBA or auto colors, set the red component.
constexpr TColor(AutoTag)
Constructs an automatically assigned color. Call as TColor col(TColor::kAuto).
float GetBlue() const
For RGBA or auto colors, get the blue component (0..1).
void SetAlpha(Alpha a)
For RGBA or auto colors, set the alpha component.
static constexpr Alpha kTransparent
A completely transparent color.
std::array< float, 3 > PredefinedRGB
bool IsRGBA() const
Determine whether this TColor is storing RGBA (in contrast to an ordinal of a TPalette).
float GetRed() const
For RGBA or auto colors, get the red component (0..1).
constexpr TColor(const PredefinedRGB &predef)
Initialize a TColor with red, green, blue and alpha component.
float fRedOrPalettePos
The "R" in RGBA (0 <= R <= 1), or the palette pos if fKind is kPalettePos.
bool IsAuto() const
Determine whether this TColor will be assigned a actual color upon drawing.
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.
constexpr TColor(float r, float g, float b, Alpha alpha=kOpaque)
Initialize a TColor with red, green, blue and alpha component.
The color is defined as a value in the TFrame's TPalette.
bool AssertNotPalettePos() const
throw an exception if the color isn't specified as kRGBA or kAuto, the two cases where asking for RBG...
static constexpr PredefinedRGB kBlack
static constexpr AutoTag kAuto
float fBlue
The "B" in RGBA (0 <= B <= 1). Unused if fKind != kRGBA.
static constexpr PredefinedRGB kBlue
static constexpr PredefinedRGB kRed
constexpr TColor()=default
float fGreen
The "G" in RGBA (0 <= G <= 1). Unused if fKind != kRGBA.
float GetPaletteOrdinal() const
If this is an ordinal in a palette, resolve the.
friend bool operator==(const TColor &lhs, const TColor &rhs)
The color is defined as specific RGBA values.
static constexpr PredefinedRGB kWhite
void SetGreen(float g)
For RGBA or auto colors, set the green component.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
A color: Red|Green|Blue|Alpha, or a position in a TPalette.
A normalized coordinate: 0 in the left, bottom corner, 1 in the top, right corner of the TPad...
EKind fKind
How the color is defined.
float fAlpha
The "A" in RGBA (0 <= A <= 1).
void SetBlue(float b)
For RGBA or auto colors, set the blue component.
bool IsPaletteOrdinal() const
Determine whether this TColor is storing an ordinal of a TPalette (in contrast to RGBA)...
void SetAlpha(float a)
For RGBA or auto colors, set the alpha component.
static constexpr double g