OpendTect  6.6
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)
 
float average () const
 
unsigned char b () const
 
float bF () const
 
Color complementaryColor () const
 
TypeSet< ColorcomplimentaryColors (int) const
 
float contrast (const Color &) const
 
Color darker (float fac) const
 
void fill (BufferString &) const
 
bool fromDescription (const char *)
 
unsigned char g () const
 
const char * getDescription () const
 
void getHSV (unsigned char &, unsigned char &, unsigned char &) const
 
float getRelLuminance () const
 
const char * getStdStr (bool withhash=true, int transpopt=0) const
 
float gF () const
 
bool isVisible () const
 
const char * largeUserInfoString () const
 
Color lighter (float fac) const
 
bool operator!= (const Color &c) const
 
bool operator== (const Color &c) const
 
unsigned char r () const
 
float rF () const
 
unsigned int & rgb ()
 
unsigned int rgb () const
 
void set (unsigned char r_, unsigned char g_, unsigned char b_, unsigned char t_=0)
 
void setHSV (unsigned char h, unsigned char s, unsigned char v)
 
void setRgb (unsigned int rgb_)
 
void setStdStr (const char *)
 e.g. "#00ff32" More...
 
void setTransparency (unsigned char t_)
 
void setTransparencyF (float tf)
 
unsigned char t () const
 
float tF () const
 
bool use (const char *)
 

Static Public Member Functions

static Color Anthracite ()
 
static Color Black ()
 
static Color Blue ()
 
static void convertFromStr (const BufferStringSet &, TypeSet< Color > &)
 
static void convertToStr (const TypeSet< Color > &, BufferStringSet &)
 
static const TypeSet< Color > & descriptionCenters ()
 
static const BufferStringSetdescriptions ()
 
static Color DgbColor ()
 
static float getFloat (unsigned char)
 
static unsigned char getUChar (float v)
 
static Color Green ()
 
static Color interpolate (const Color &, const Color &, float frac=0.5)
 
static Color LightGrey ()
 
static Color NoColor ()
 
static int nrStdDrawColors ()
 
static Color Orange ()
 
static Color Peach ()
 
static Color Red ()
 
static Color stdDrawColor (int)
 
static Color White ()
 
static Color Yellow ()
 

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() [1/2]

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

◆ Color() [2/2]

Color::Color ( unsigned int  rgbval)

Member Function Documentation

◆ Anthracite()

static Color Color::Anthracite ( )
inlinestatic

◆ average()

float Color::average ( ) const
inline

◆ b()

unsigned char Color::b ( ) const

◆ bF()

float Color::bF ( ) const
inline

◆ Black()

static Color Color::Black ( )
inlinestatic

◆ Blue()

static Color Color::Blue ( )
inlinestatic

◆ complementaryColor()

Color Color::complementaryColor ( ) const

◆ complimentaryColors()

TypeSet<Color> Color::complimentaryColors ( int  ) const

◆ contrast()

float Color::contrast ( const Color ) const

◆ convertFromStr()

static void Color::convertFromStr ( const BufferStringSet ,
TypeSet< Color > &   
)
static

◆ convertToStr()

static void Color::convertToStr ( const TypeSet< Color > &  ,
BufferStringSet  
)
static

◆ darker()

Color Color::darker ( float  fac) const
inline

◆ descriptionCenters()

static const TypeSet<Color>& Color::descriptionCenters ( )
static

◆ descriptions()

static const BufferStringSet& Color::descriptions ( )
static

◆ DgbColor()

static Color Color::DgbColor ( )
inlinestatic

◆ fill()

void Color::fill ( BufferString ) const

◆ fromDescription()

bool Color::fromDescription ( const char *  )

◆ g()

unsigned char Color::g ( ) const

◆ getDescription()

const char* Color::getDescription ( ) const

◆ getFloat()

static float Color::getFloat ( unsigned char  )
static

◆ getHSV()

void Color::getHSV ( unsigned char &  ,
unsigned char &  ,
unsigned char &   
) const

◆ getRelLuminance()

float Color::getRelLuminance ( ) const

◆ getStdStr()

const char* Color::getStdStr ( bool  withhash = true,
int  transpopt = 0 
) const

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

◆ getUChar()

static unsigned char Color::getUChar ( float  v)
static

◆ gF()

float Color::gF ( ) const
inline

◆ Green()

static Color Color::Green ( )
inlinestatic

◆ interpolate()

static Color Color::interpolate ( const Color ,
const Color ,
float  frac = 0.5 
)
static

◆ isVisible()

bool Color::isVisible ( ) const

◆ largeUserInfoString()

const char* Color::largeUserInfoString ( ) const

◆ lighter()

Color Color::lighter ( float  fac) const

◆ LightGrey()

static Color Color::LightGrey ( )
inlinestatic

◆ NoColor()

static Color Color::NoColor ( )
inlinestatic

◆ nrStdDrawColors()

static int Color::nrStdDrawColors ( )
static

◆ operator!=()

bool Color::operator!= ( const Color c) const

◆ operator==()

bool Color::operator== ( const Color c) const

◆ Orange()

static Color Color::Orange ( )
inlinestatic

◆ Peach()

static Color Color::Peach ( )
inlinestatic

◆ r()

unsigned char Color::r ( ) const

◆ Red()

static Color Color::Red ( )
inlinestatic

◆ rF()

float Color::rF ( ) const
inline

◆ rgb() [1/2]

unsigned int& Color::rgb ( )

◆ rgb() [2/2]

unsigned int Color::rgb ( ) const

◆ set()

void Color::set ( unsigned char  r_,
unsigned char  g_,
unsigned char  b_,
unsigned char  t_ = 0 
)

◆ setHSV()

void Color::setHSV ( unsigned char  h,
unsigned char  s,
unsigned char  v 
)

◆ setRgb()

void Color::setRgb ( unsigned int  rgb_)

◆ setStdStr()

void Color::setStdStr ( const char *  )

e.g. "#00ff32"

◆ setTransparency()

void Color::setTransparency ( unsigned char  t_)

◆ setTransparencyF()

void Color::setTransparencyF ( float  tf)

◆ stdDrawColor()

static Color Color::stdDrawColor ( int  )
static

◆ t()

unsigned char Color::t ( ) const

◆ tF()

float Color::tF ( ) const
inline

◆ use()

bool Color::use ( const char *  )

◆ White()

static Color Color::White ( )
inlinestatic

◆ Yellow()

static Color Color::Yellow ( )
inlinestatic

Member Data Documentation

◆ col_

unsigned int Color::col_
protected

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