OpendTect  6.3
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Color Class Reference

Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt. More...

Public Member Functions

 Color (unsigned char r_=255, unsigned char g_=255, unsigned char b_=255, unsigned char t_=0)
 
 Color (unsigned int rgbval)
 
bool operator== (const Color &c) const
 
bool operator!= (const Color &c) const
 
unsigned char r () const
 
unsigned char g () const
 
unsigned char b () const
 
unsigned char t () const
 
float rF () const
 
float gF () const
 
float bF () const
 
float tF () const
 
bool isVisible () const
 
unsigned int rgb () const
 
unsigned int & rgb ()
 
void set (unsigned char r_, unsigned char g_, unsigned char b_, unsigned char t_=0)
 
float average () const
 
Color complementaryColor () const
 
Color lighter (float fac) const
 
Color darker (float fac) const
 
void setRgb (unsigned int rgb_)
 
void setTransparency (unsigned char t_)
 
void setTransparencyF (float tf)
 should be from 0 to 1 More...
 
void setHSV (unsigned char h, unsigned char s, unsigned char v)
 
void getHSV (unsigned char &, unsigned char &, unsigned char &) const
 
void setStdStr (const char *)
 e.g. "#00ff32" More...
 
BufferString getStdStr (bool withhash=true, int transpopt=0) const
 
void fill (BufferString &) const
 
bool use (const char *)
 
BufferString getDescription () const
 
bool fromDescription (const char *)
 
BufferString largeUserInfoString () const
 

Static Public Member Functions

static Color between (Color, Color, float relpos=0.5f)
 
static Color NoColor ()
 
static Color Black ()
 
static Color Blue ()
 
static Color DgbColor ()
 
static Color Green ()
 
static Color LightGrey ()
 
static Color Orange ()
 
static Color Peach ()
 
static Color Pink ()
 
static Color Red ()
 
static Color White ()
 
static Color Yellow ()
 
static unsigned char getUChar (float v)
 
static float getFloat (unsigned char)
 
static int nrStdDrawColors ()
 
static Color stdDrawColor (int)
 
static Color stdDrawColor (const char *)
 
static Color getColorFromDescription (const char *)
 
static void getDescriptions (BufferStringSet &)
 
static void getDescriptionCenters (TypeSet< Color > &)
 

Protected Attributes

unsigned int col_
 

Detailed Description

Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.

Constructor & Destructor Documentation

Color::Color ( unsigned char  r_ = 255,
unsigned char  g_ = 255,
unsigned char  b_ = 255,
unsigned char  t_ = 0 
)
Color::Color ( unsigned int  rgbval)

Member Function Documentation

float Color::average ( ) const
inline
unsigned char Color::b ( ) const
static Color Color::between ( Color  ,
Color  ,
float  relpos = 0.5f 
)
static
float Color::bF ( ) const
inline
static Color Color::Black ( )
inlinestatic
static Color Color::Blue ( )
inlinestatic
Color Color::complementaryColor ( ) const
Color Color::darker ( float  fac) const
inline
static Color Color::DgbColor ( )
inlinestatic
void Color::fill ( BufferString ) const
bool Color::fromDescription ( const char *  )
unsigned char Color::g ( ) const
static Color Color::getColorFromDescription ( const char *  )
static
BufferString Color::getDescription ( ) const
static void Color::getDescriptionCenters ( TypeSet< Color > &  )
static
static void Color::getDescriptions ( BufferStringSet )
static
static float Color::getFloat ( unsigned  char)
static
void Color::getHSV ( unsigned char &  ,
unsigned char &  ,
unsigned char &   
) const
BufferString Color::getStdStr ( bool  withhash = true,
int  transpopt = 0 
) const

without hash Google KML standard -> order reversed transpopt -1=opacity 0=not 1=transparency

static unsigned char Color::getUChar ( float  v)
static
float Color::gF ( ) const
inline
static Color Color::Green ( )
inlinestatic
bool Color::isVisible ( ) const
BufferString Color::largeUserInfoString ( ) const
Color Color::lighter ( float  fac) const
static Color Color::LightGrey ( )
inlinestatic
static Color Color::NoColor ( )
inlinestatic
static int Color::nrStdDrawColors ( )
static
bool Color::operator!= ( const Color c) const
bool Color::operator== ( const Color c) const
static Color Color::Orange ( )
inlinestatic
static Color Color::Peach ( )
inlinestatic
static Color Color::Pink ( )
inlinestatic
unsigned char Color::r ( ) const
static Color Color::Red ( )
inlinestatic
float Color::rF ( ) const
inline
unsigned int Color::rgb ( ) const
unsigned int& Color::rgb ( )
void Color::set ( unsigned char  r_,
unsigned char  g_,
unsigned char  b_,
unsigned char  t_ = 0 
)
void Color::setHSV ( unsigned char  h,
unsigned char  s,
unsigned char  v 
)
void Color::setRgb ( unsigned int  rgb_)
void Color::setStdStr ( const char *  )

e.g. "#00ff32"

void Color::setTransparency ( unsigned char  t_)
void Color::setTransparencyF ( float  tf)

should be from 0 to 1

static Color Color::stdDrawColor ( int  )
static
static Color Color::stdDrawColor ( const char *  )
static
unsigned char Color::t ( ) const
float Color::tF ( ) const
inline
bool Color::use ( const char *  )
static Color Color::White ( )
inlinestatic
static Color Color::Yellow ( )
inlinestatic

Member Data Documentation

unsigned int Color::col_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017