the class to store a color More...
#include <libstaroffice_internal.hxx>
Public Member Functions | |
STOFFColor (uint32_t argb=0) | |
constructor | |
STOFFColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) | |
constructor from color | |
STOFFColor & | operator= (uint32_t argb) |
operator= | |
uint32_t | value () const |
return the rgba value | |
unsigned char | getAlpha () const |
returns the alpha value | |
void | setAlpha (unsigned char alpha) |
reset the alpha value | |
unsigned char | getBlue () const |
returns the green value | |
unsigned char | getRed () const |
returns the red value | |
unsigned char | getGreen () const |
returns the green value | |
bool | isBlack () const |
return true if the color is black | |
bool | isWhite () const |
return true if the color is white | |
bool | operator== (STOFFColor const &c) const |
operator== | |
bool | operator!= (STOFFColor const &c) const |
operator!= | |
bool | operator< (STOFFColor const &c) const |
operator< | |
bool | operator<= (STOFFColor const &c) const |
operator<= | |
bool | operator> (STOFFColor const &c) const |
operator> | |
bool | operator>= (STOFFColor const &c) const |
operator>= | |
std::string | str () const |
print the color in the form #rrggbb | |
Static Public Member Functions | |
static STOFFColor | colorFromCMYK (unsigned char c, unsigned char m, unsigned char y, unsigned char k) |
return a color from a cmyk color ( basic) | |
static STOFFColor | colorFromHSL (unsigned char H, unsigned char S, unsigned char L) |
return a color from a hsl color (basic) | |
static STOFFColor | black () |
return the back color | |
static STOFFColor | white () |
return the white color | |
static STOFFColor | barycenter (float alpha, STOFFColor const &colA, float beta, STOFFColor const &colB) |
return alpha*colA+beta*colB | |
Protected Attributes | |
uint32_t | m_value |
the argb color | |
Friends | |
std::ostream & | operator<< (std::ostream &o, STOFFColor const &c) |
operator<< in the form #rrggbb | |
the class to store a color
|
inlineexplicit |
constructor
Referenced by barycenter(), black(), colorFromCMYK(), colorFromHSL(), and white().
|
inline |
constructor from color
|
static |
return alpha*colA+beta*colB
Referenced by StarGraphicStruct::StarBrush::getColor().
|
inlinestatic |
return the back color
Referenced by StarCharAttribute::addInitTo(), and StarGraphicAttribute::addInitTo().
|
inlinestatic |
return a color from a cmyk color ( basic)
|
inlinestatic |
return a color from a hsl color (basic)
|
inline |
return true if the color is black
Referenced by STOFFFont::addTo(), StarPageAttribute::StarPAttributeColumns::printData(), StarAttributeManager::readAttribute(), StarObjectNumericRuler::readAttributeLevel(), and StarFileManager::readSVGDI().
|
inline |
return true if the color is white
Referenced by StarFrameAttribute::StarFAttributeShadow::printData(), and StarObjectChart::readSCHAttributes().
|
inline |
operator!=
|
inline |
operator<
Referenced by operator>=().
|
inline |
operator<=
Referenced by operator>().
|
inline |
operator=
|
inline |
operator==
Referenced by operator!=().
|
inline |
operator>
|
inline |
operator>=
std::string STOFFColor::str | ( | ) | const |
print the color in the form #rrggbb
Referenced by STOFFFont::addTo(), STOFFBorderLine::addTo(), StarCharAttribute::StarCAttributeColor::addTo(), StarFrameAttribute::StarFAttributeBrush::addTo(), StarFrameAttribute::StarFAttributeShadow::addTo(), StarGraphicAttribute::StarGAttributeNamedColor::addTo(), StarGraphicAttribute::StarGAttributeNamedHatch::addTo(), and StarObjectNumericRuler::readAttributeLevel().
|
inline |
return the rgba value
Referenced by barycenter(), colorFromCMYK(), colorFromHSL(), StarGraphicStruct::getBMPData(), operator!=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), setAlpha(), and str().
|
inlinestatic |
return the white color
Referenced by StarGraphicAttribute::addInitTo(), and StarObjectSmallGraphicInternal::SDUDGraphicAnimation::SDUDGraphicAnimation().
|
friend |
operator<< in the form #rrggbb
|
protected |
the argb color
Referenced by getAlpha(), getBlue(), getGreen(), getRed(), isBlack(), isWhite(), operator<(), operator<=(), operator=(), operator==(), setAlpha(), and value().