22 namespace Experimental {
34 explicit operator float()
const {
return fVal; }
73 constexpr
TColor() =
default;
205 inline TPadCoord::Normal
operator"" _alpha(
long double val)
207 return TPadCoord::Normal{(double)val};
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.
static constexpr PredefinedRGB kGreen
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).
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
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.
float GetAlpha() const
For RGBA or auto colors, get the alpha component (0..1).
bool AssertNotPalettePos() const
throw an exception if the color isn't specified as kRGBA or kAuto, the two cases where asking for RBG...
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.
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
bool IsPaletteOrdinal() const
Determine whether this TColor is storing an ordinal of a TPalette (in contrast to RGBA)...
static constexpr PredefinedRGB kRed
float GetBlue() const
For RGBA or auto colors, get the blue component (0..1).
float GetRed() const
For RGBA or auto colors, get the red component (0..1).
constexpr TColor()=default
bool IsAuto() const
Determine whether this TColor will be assigned a actual color upon drawing.
float fGreen
The "G" in RGBA (0 <= G <= 1). Unused if fKind != kRGBA.
friend bool operator==(const TColor &lhs, const TColor &rhs)
bool IsRGBA() const
Determine whether this TColor is storing RGBA (in contrast to an ordinal of a TPalette).
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.
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.
void SetAlpha(float a)
For RGBA or auto colors, set the alpha component.
float GetPaletteOrdinal() const
If this is an ordinal in a palette, resolve the.
float GetGreen() const
For RGBA or auto colors, get the green component (0..1).
static constexpr double g