xlnt
Public Member Functions | Static Public Member Functions | List of all members
xlnt::color Class Reference

Colors can be applied to many parts of a cell's style. More...

#include <color.hpp>

Public Member Functions

 color ()
 Constructs a default color More...
 
 color (const rgb_color &rgb)
 Constructs a color from a given RGB color More...
 
 color (const indexed_color &indexed)
 Constructs a color from a given indexed color More...
 
 color (const theme_color &theme)
 Constructs a color from a given theme color More...
 
color_type type () const
 Returns the type of this color More...
 
bool auto_ () const
 Returns true if this color has been set to auto More...
 
void auto_ (bool value)
 Sets the auto property of this color to value More...
 
const rgb_colorrgb () const
 Returns the internal indexed color representing this color. If this is not an RGB color, an invalid_attribute exception will be thrown. More...
 
rgb_colorrgb ()
 Returns the internal indexed color representing this color. If this is not an RGB color, an invalid_attribute exception will be thrown. More...
 
const indexed_colorindexed () const
 Returns the internal indexed color representing this color. If this is not an indexed color, an invalid_attribute exception will be thrown. More...
 
indexed_colorindexed ()
 Returns the internal indexed color representing this color. If this is not an indexed color, an invalid_attribute exception will be thrown. More...
 
const theme_colortheme () const
 Returns the internal indexed color representing this color. If this is not a theme color, an invalid_attribute exception will be thrown. More...
 
theme_colortheme ()
 Returns the internal indexed color representing this color. If this is not a theme color, an invalid_attribute exception will be thrown. More...
 
bool has_tint () const
 Returns true if tint is set More...
 
double tint () const
 Returns the tint of this color. More...
 
void tint (double tint)
 Sets the tint of this color to tint. Tints lighten or darken an existing color by multiplying the color with the tint. More...
 
bool operator== (const color &other) const
 Returns true if this color is equivalent to other More...
 
bool operator!= (const color &other) const
 Returns true if this color is not equivalent to other More...
 

Static Public Member Functions

static const color black ()
 Returns the color #000000 More...
 
static const color white ()
 Returns the color #ffffff More...
 
static const color red ()
 Returns the color #ff0000 More...
 
static const color darkred ()
 Returns the color #8b0000 More...
 
static const color blue ()
 Returns the color #00ff00 More...
 
static const color darkblue ()
 Returns the color #008b00 More...
 
static const color green ()
 Returns the color #0000ff More...
 
static const color darkgreen ()
 Returns the color #00008b More...
 
static const color yellow ()
 Returns the color #ffff00 More...
 
static const color darkyellow ()
 Returns the color #cccc00 More...
 

Detailed Description

Colors can be applied to many parts of a cell's style.

Constructor & Destructor Documentation

◆ color() [1/4]

xlnt::color::color ( )

Constructs a default color

◆ color() [2/4]

xlnt::color::color ( const rgb_color rgb)

Constructs a color from a given RGB color

◆ color() [3/4]

xlnt::color::color ( const indexed_color indexed)

Constructs a color from a given indexed color

◆ color() [4/4]

xlnt::color::color ( const theme_color theme)

Constructs a color from a given theme color

Member Function Documentation

◆ auto_() [1/2]

bool xlnt::color::auto_ ( ) const

Returns true if this color has been set to auto

◆ auto_() [2/2]

void xlnt::color::auto_ ( bool  value)

Sets the auto property of this color to value

◆ black()

static const color xlnt::color::black ( )
static

Returns the color #000000

◆ blue()

static const color xlnt::color::blue ( )
static

Returns the color #00ff00

◆ darkblue()

static const color xlnt::color::darkblue ( )
static

Returns the color #008b00

◆ darkgreen()

static const color xlnt::color::darkgreen ( )
static

Returns the color #00008b

◆ darkred()

static const color xlnt::color::darkred ( )
static

Returns the color #8b0000

◆ darkyellow()

static const color xlnt::color::darkyellow ( )
static

Returns the color #cccc00

◆ green()

static const color xlnt::color::green ( )
static

Returns the color #0000ff

◆ has_tint()

bool xlnt::color::has_tint ( ) const

Returns true if tint is set

◆ indexed() [1/2]

const indexed_color& xlnt::color::indexed ( ) const

Returns the internal indexed color representing this color. If this is not an indexed color, an invalid_attribute exception will be thrown.

◆ indexed() [2/2]

indexed_color& xlnt::color::indexed ( )

Returns the internal indexed color representing this color. If this is not an indexed color, an invalid_attribute exception will be thrown.

◆ operator!=()

bool xlnt::color::operator!= ( const color other) const

Returns true if this color is not equivalent to other

◆ operator==()

bool xlnt::color::operator== ( const color other) const

Returns true if this color is equivalent to other

◆ red()

static const color xlnt::color::red ( )
static

Returns the color #ff0000

◆ rgb() [1/2]

const rgb_color& xlnt::color::rgb ( ) const

Returns the internal indexed color representing this color. If this is not an RGB color, an invalid_attribute exception will be thrown.

◆ rgb() [2/2]

rgb_color& xlnt::color::rgb ( )

Returns the internal indexed color representing this color. If this is not an RGB color, an invalid_attribute exception will be thrown.

◆ theme() [1/2]

const theme_color& xlnt::color::theme ( ) const

Returns the internal indexed color representing this color. If this is not a theme color, an invalid_attribute exception will be thrown.

◆ theme() [2/2]

theme_color& xlnt::color::theme ( )

Returns the internal indexed color representing this color. If this is not a theme color, an invalid_attribute exception will be thrown.

◆ tint() [1/2]

double xlnt::color::tint ( ) const

Returns the tint of this color.

◆ tint() [2/2]

void xlnt::color::tint ( double  tint)

Sets the tint of this color to tint. Tints lighten or darken an existing color by multiplying the color with the tint.

◆ type()

color_type xlnt::color::type ( ) const

Returns the type of this color

◆ white()

static const color xlnt::color::white ( )
static

Returns the color #ffffff

◆ yellow()

static const color xlnt::color::yellow ( )
static

Returns the color #ffff00


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