TColor


class description - source file - inheritance tree

class TColor : public TNamed

    private:
void Allocate() static Float_t HLStoRGB1(Float_t rn1, Float_t rn2, Float_t huei) public:
TColor TColor() TColor TColor(Int_t color, Float_t r, Float_t g, Float_t b, const char* name) TColor TColor(const TColor& color) virtual void ~TColor() static TClass* Class() virtual void Copy(TObject& color) Float_t GetBlue() const static Int_t GetColor(const char* hexcolor) static Int_t GetColor(Float_t r, Float_t g, Float_t b) static Int_t GetColor(Int_t r, Int_t g, Int_t b) Float_t GetGreen() const virtual void GetHLS(Float_t& h, Float_t& l, Float_t& s) const Float_t GetHue() const Float_t GetLight() const Int_t GetNumber() const Float_t GetRed() const virtual void GetRGB(Float_t& r, Float_t& g, Float_t& b) const Float_t GetSaturation() const static void HLStoRGB(Float_t h, Float_t l, Float_t s, Float_t& r, Float_t& g, Float_t& b) virtual TClass* IsA() const virtual void ls(Option_t* option) const virtual void Print(Option_t* option) const static void RGBtoHLS(Float_t r, Float_t g, Float_t b, Float_t& h, Float_t& l, Float_t& s) virtual void SetRGB(Float_t r, Float_t g, Float_t b) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
Int_t fNumber Color number identifier Float_t fRed Fraction of Red Float_t fGreen Fraction of Green Float_t fBlue Fraction of Blue Float_t fHue Hue Float_t fLight Light Float_t fSaturation Saturation

Class Description

                                                                      
 TColor                                                               
                                                                      
 Color defined by RGB or HLS.                                         
 At initialization time, a table of colors is generated. This linked  
 list can be accessed from the ROOT object                            
 (see TROOT::GetListOfColors()). When a color is defined in the range 
 of [1,50], two "companion" colors are also defined:                  
    - the dark version (color_index + 100)                            
    - the bright version (color_index + 150)                          
 The dark and bright color are used to give 3-D effects when drawing  
 various boxes (see TWbox, TPave, TPaveText, TPaveLabel,etc).         
                                                                      
 This is the list of currently supported basic colors (here dark and  
 bright colors are not shown).                                        

/*

*/

                                                                      


TColor(): TNamed()
 Default ctor.

TColor(Int_t color, Float_t r, Float_t g, Float_t b, const char *name) : TNamed(name,"")
 Normal color constructor. Initialize a color structure.
 Compute the RGB and HLS parameters

~TColor()
 Color destructor.

TColor(const TColor &color)
 Color copy ctor.

void Copy(TObject &obj)
 Copy this color to obj.

void HLStoRGB(Float_t hue, Float_t light, Float_t satur, Float_t &r, Float_t &g, Float_t &b)
 Static method to compute HLS from RGB (see HIGZ routine IGHTOR).

Float_t HLStoRGB1(Float_t rn1, Float_t rn2, Float_t huei)
 Static method. Auxiliary to HLStoRGB (see HIGZ routine IGHR01).

void ls(Option_t *) const
 List this color with its attributes.

void Print(Option_t *) const
 Dump this color with its attributes.

void RGBtoHLS(Float_t r, Float_t g, Float_t b, Float_t &hue, Float_t &light, Float_t &satur )
 Static method to compute HLS from RGB.

void SetRGB(Float_t r, Float_t g, Float_t b)
 Initialize this color and its assosiated colors.

void Allocate()
 Make this color known to the graphics system.

Int_t GetColor(const char *hexcolor)
 Static method returning color number for color specified by
 hex color string of form: #rrggbb, where rr, gg and bb are in
 hex between [0,FF], e.g. "#c0c0c0".
 If color specified color does not exist it will be created
 with as name "#rrggbb".

Int_t GetColor(Float_t r, Float_t g, Float_t b)
 Static method returning color number for color specified by
 r, g and b. The r,g,b should be in the range [0,1].
 If color specified color does not exist it will be created
 with as name "#rrggbb" with rr, gg and bb are in hex between
 [0,255].

Int_t GetColor(Int_t r, Int_t g, Int_t b)
 Static method returning color number for color specified by
 r, g and b. The r,g,b should be in the range [0,255].
 If color specified color does not exist it will be created
 with as name "#rrggbb" with rr, gg and bb are in hex between.



Inline Functions


               void GetRGB(Float_t& r, Float_t& g, Float_t& b) const
               void GetHLS(Float_t& h, Float_t& l, Float_t& s) const
              Int_t GetNumber() const
            Float_t GetRed() const
            Float_t GetGreen() const
            Float_t GetBlue() const
            Float_t GetHue() const
            Float_t GetLight() const
            Float_t GetSaturation() const
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)


Author: Rene Brun 12/12/94
Last update: root/base:$Name: $:$Id: TColor.cxx,v 1.7 2001/07/17 09:06:55 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.