Logo ROOT   6.12/07
Reference Guide
TColor.cxx
Go to the documentation of this file.
1 /// \file TColor.cxx
2 /// \ingroup Gpad ROOT7
3 /// \author Axel Naumann <axel@cern.ch>
4 /// \date 2017-09-27
5 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6 /// is welcome!
7 
8 /*************************************************************************
9  * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
10  * All rights reserved. *
11  * *
12  * For the licensing terms see $ROOTSYS/LICENSE. *
13  * For the list of contributors see $ROOTSYS/README/CREDITS. *
14  *************************************************************************/
15 
16 #include "ROOT/TColor.hxx"
17 
18 #include <exception>
19 
20 using namespace ROOT::Experimental;
21 
22 // TColor constexpr values:
23 constexpr TColor::Alpha TColor::kOpaque;
24 constexpr TColor::Alpha TColor::kTransparent;
30 constexpr TColor::AutoTag TColor::kAuto;
31 
32 
34 {
36  throw std::runtime_error("This color does not represent a palette ordinal!");
37  return fRedOrPalettePos;
38 }
39 
41 {
42  if (fKind == EKind::kPalettePos) {
43  throw std::runtime_error("This color does not represent a palette ordinal!");
44  return false;
45  }
46  return true;
47 }
static constexpr PredefinedRGB kGreen
Definition: TColor.hxx:186
static constexpr Alpha kOpaque
An opaque color.
Definition: TColor.hxx:37
static constexpr Alpha kTransparent
A completely transparent color.
Definition: TColor.hxx:39
std::array< float, 3 > PredefinedRGB
Definition: TColor.hxx:70
float fRedOrPalettePos
The "R" in RGBA (0 <= R <= 1), or the palette pos if fKind is kPalettePos.
Definition: TColor.hxx:50
The color is defined as a value in the TFrame&#39;s TPalette.
bool AssertNotPalettePos() const
throw an exception if the color isn&#39;t specified as kRGBA or kAuto, the two cases where asking for RBG...
Definition: TColor.cxx:40
static constexpr PredefinedRGB kBlack
Definition: TColor.hxx:189
static constexpr AutoTag kAuto
Definition: TColor.hxx:190
static constexpr PredefinedRGB kBlue
Definition: TColor.hxx:187
static constexpr PredefinedRGB kRed
Definition: TColor.hxx:185
float GetPaletteOrdinal() const
If this is an ordinal in a palette, resolve the.
Definition: TColor.cxx:33
static constexpr PredefinedRGB kWhite
Definition: TColor.hxx:188
EKind fKind
How the color is defined.
Definition: TColor.hxx:63