Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TColorNumber Class Reference

Definition at line 140 of file TColor.h.

Public Member Functions

 TColorNumber (Int_t color)
 
 TColorNumber (std::array< Float_t, 3 > rgb)
 Instantiate a color from a tuple of RGB values between 0.0 and 1.0.
 
 TColorNumber (std::string const &color)
 The color string argument argument will be evaluated to get the actual ROOT color number, like kRed.
 
Int_t number () const
 

Private Attributes

Int_t fNumber
 Color number identifier.
 

#include <TColor.h>

Constructor & Destructor Documentation

◆ TColorNumber() [1/3]

TColorNumber::TColorNumber ( Int_t color)
inline

Definition at line 142 of file TColor.h.

◆ TColorNumber() [2/3]

TColorNumber::TColorNumber ( std::string const & color)

The color string argument argument will be evaluated to get the actual ROOT color number, like kRed.

Here is how the string is parsed:

  1. Match against single-character color codes following the matplotlib convention. For example, to get red color (equivalent to kRed): ~~~ {.cxx} hist.SetLineColor("r") ~~~
  2. Check if the string matches an en existing TColor name (see TColor::GetColorByName()). For example: ~~~ {.cxx} hist.SetLineColor("kRed+1") ~~~

In case no corresponding color is found, a std::invalid_argument exception is thrown.

Definition at line 3670 of file TColor.cxx.

◆ TColorNumber() [3/3]

TColorNumber::TColorNumber ( std::array< Float_t, 3 > rgb)

Instantiate a color from a tuple of RGB values between 0.0 and 1.0.

Definition at line 3692 of file TColor.cxx.

Member Function Documentation

◆ number()

Int_t TColorNumber::number ( ) const
inline

Definition at line 145 of file TColor.h.

Member Data Documentation

◆ fNumber

Int_t TColorNumber::fNumber
private

Color number identifier.

Definition at line 148 of file TColor.h.

Libraries for TColorNumber:

The documentation for this class was generated from the following files: