Logo ROOT  
Reference Guide
TGLColor Class Reference

Class encapsulating color information in preferred GL format - an array of four unsigned bytes.

Color index is also cached for easier interfacing with the traditional ROOT graphics.

Definition at line 783 of file TGLUtil.h.

Public Member Functions

 TGLColor ()
 Default constructor. Color is initialized to black. More...
 
 TGLColor (Color_t color_index, Char_t transparency=0)
 Constructor from color-index and transparency. More...
 
 TGLColor (const TGLColor &c)
 copy constructor More...
 
 TGLColor (Float_t r, Float_t g, Float_t b, Float_t a=1)
 Constructor from Float_t values. More...
 
 TGLColor (Int_t r, Int_t g, Int_t b, Int_t a=255)
 Constructor from Int_t values. More...
 
UChar_tArr ()
 
TString AsString () const
 Return string describing the color. More...
 
const UChar_tCArr () const
 
 ClassDefNV (TGLColor, 0)
 
UChar_t GetAlpha () const
 
UChar_t GetBlue () const
 
Color_t GetColorIndex () const
 Returns color-index representing the color. More...
 
UChar_t GetGreen () const
 
UChar_t GetRed () const
 
Char_t GetTransparency () const
 Returns transparency value. More...
 
TGLColoroperator= (const TGLColor &c)
 Assignment operator. More...
 
void SetAlpha (Int_t v)
 
void SetBlue (Int_t v)
 
void SetColor (Color_t color_index)
 Set color by color-index. More...
 
void SetColor (Color_t color_index, Char_t transparency)
 Set color by color-index and alpha from the transparency. More...
 
void SetColor (Float_t r, Float_t g, Float_t b, Float_t a=1)
 Set color with Float_t values. More...
 
void SetColor (Int_t r, Int_t g, Int_t b, Int_t a=255)
 Set color with Int_t values. More...
 
void SetGreen (Int_t v)
 
void SetRed (Int_t v)
 
void SetTransparency (Char_t transparency)
 Set alpha from the transparency. More...
 

Protected Attributes

Short_t fIndex
 
UChar_t fRGBA [4]
 

#include <TGLUtil.h>

Constructor & Destructor Documentation

◆ TGLColor() [1/5]

TGLColor::TGLColor ( )

Default constructor. Color is initialized to black.

Definition at line 1159 of file TGLUtil.cxx.

◆ TGLColor() [2/5]

TGLColor::TGLColor ( Int_t  r,
Int_t  g,
Int_t  b,
Int_t  a = 255 
)

Constructor from Int_t values.

Definition at line 1169 of file TGLUtil.cxx.

◆ TGLColor() [3/5]

TGLColor::TGLColor ( Float_t  r,
Float_t  g,
Float_t  b,
Float_t  a = 1 
)

Constructor from Float_t values.

Definition at line 1177 of file TGLUtil.cxx.

◆ TGLColor() [4/5]

TGLColor::TGLColor ( Color_t  color_index,
Char_t  transparency = 0 
)

Constructor from color-index and transparency.

Definition at line 1185 of file TGLUtil.cxx.

◆ TGLColor() [5/5]

TGLColor::TGLColor ( const TGLColor c)

copy constructor

Definition at line 1193 of file TGLUtil.cxx.

Member Function Documentation

◆ Arr()

UChar_t * TGLColor::Arr ( )
inline

Definition at line 798 of file TGLUtil.h.

◆ AsString()

TString TGLColor::AsString ( ) const

Return string describing the color.

Definition at line 1321 of file TGLUtil.cxx.

◆ CArr()

const UChar_t * TGLColor::CArr ( ) const
inline

Definition at line 799 of file TGLUtil.h.

◆ ClassDefNV()

TGLColor::ClassDefNV ( TGLColor  ,
 
)

◆ GetAlpha()

UChar_t TGLColor::GetAlpha ( ) const
inline

Definition at line 804 of file TGLUtil.h.

◆ GetBlue()

UChar_t TGLColor::GetBlue ( ) const
inline

Definition at line 803 of file TGLUtil.h.

◆ GetColorIndex()

Color_t TGLColor::GetColorIndex ( ) const

Returns color-index representing the color.

Definition at line 1218 of file TGLUtil.cxx.

◆ GetGreen()

UChar_t TGLColor::GetGreen ( ) const
inline

Definition at line 802 of file TGLUtil.h.

◆ GetRed()

UChar_t TGLColor::GetRed ( ) const
inline

Definition at line 801 of file TGLUtil.h.

◆ GetTransparency()

Char_t TGLColor::GetTransparency ( ) const

Returns transparency value.

Definition at line 1228 of file TGLUtil.cxx.

◆ operator=()

TGLColor & TGLColor::operator= ( const TGLColor c)

Assignment operator.

Definition at line 1205 of file TGLUtil.cxx.

◆ SetAlpha()

void TGLColor::SetAlpha ( Int_t  v)
inline

Definition at line 812 of file TGLUtil.h.

◆ SetBlue()

void TGLColor::SetBlue ( Int_t  v)
inline

Definition at line 811 of file TGLUtil.h.

◆ SetColor() [1/4]

void TGLColor::SetColor ( Color_t  color_index)

Set color by color-index.

Alpha is not changed. If color_index is not valid, color is set to magenta.

Definition at line 1261 of file TGLUtil.cxx.

◆ SetColor() [2/4]

void TGLColor::SetColor ( Color_t  color_index,
Char_t  transparency 
)

Set color by color-index and alpha from the transparency.

If color_index is not valid, color is set to magenta.

Definition at line 1285 of file TGLUtil.cxx.

◆ SetColor() [3/4]

void TGLColor::SetColor ( Float_t  r,
Float_t  g,
Float_t  b,
Float_t  a = 1 
)

Set color with Float_t values.

Definition at line 1248 of file TGLUtil.cxx.

◆ SetColor() [4/4]

void TGLColor::SetColor ( Int_t  r,
Int_t  g,
Int_t  b,
Int_t  a = 255 
)

Set color with Int_t values.

Definition at line 1236 of file TGLUtil.cxx.

◆ SetGreen()

void TGLColor::SetGreen ( Int_t  v)
inline

Definition at line 810 of file TGLUtil.h.

◆ SetRed()

void TGLColor::SetRed ( Int_t  v)
inline

Definition at line 809 of file TGLUtil.h.

◆ SetTransparency()

void TGLColor::SetTransparency ( Char_t  transparency)

Set alpha from the transparency.

Definition at line 1313 of file TGLUtil.cxx.

Member Data Documentation

◆ fIndex

Short_t TGLColor::fIndex
mutableprotected

Definition at line 787 of file TGLUtil.h.

◆ fRGBA

UChar_t TGLColor::fRGBA[4]
protected

Definition at line 786 of file TGLUtil.h.


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