the class to store a color More...
#include <libwps_internal.h>
Public Member Functions | |
WPSColor (uint32_t argb=0) | |
constructor | |
WPSColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) | |
constructor from color | |
WPSColor & | operator= (uint32_t argb) |
operator= | |
uint32_t | value () const |
return the rgba value | |
unsigned char | getAlpha () const |
returns 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== (WPSColor const &c) const |
operator== | |
bool | operator!= (WPSColor const &c) const |
operator!= | |
bool | operator< (WPSColor const &c) const |
operator< | |
bool | operator<= (WPSColor const &c) const |
operator<= | |
bool | operator> (WPSColor const &c) const |
operator> | |
bool | operator>= (WPSColor const &c) const |
operator>= | |
std::string | str () const |
print the color in the form #rrggbb | |
Static Public Member Functions | |
static WPSColor | black () |
return the back color | |
static WPSColor | white () |
return the white color | |
static WPSColor | barycenter (float alpha, WPSColor const &colA, float beta, WPSColor const &colB) |
return alpha*colA+beta*colB | |
Protected Attributes | |
uint32_t | m_value |
the argb color | |
Friends | |
std::ostream & | operator<< (std::ostream &o, WPSColor const &c) |
operator<< in the form #rrggbb |
the class to store a color
WPSColor::WPSColor | ( | uint32_t | argb = 0 | ) | [inline] |
WPSColor::WPSColor | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | a = 255 |
||
) | [inline] |
constructor from color
WPSColor WPSColor::barycenter | ( | float | alpha, |
WPSColor const & | colA, | ||
float | beta, | ||
WPSColor const & | colB | ||
) | [static] |
return alpha*colA+beta*colB
Referenced by WPSGraphicStyle::Pattern::getAverageColor(), LotusStyleManager::readLineStyle(), WPS8Table::readMCLD(), WKS4Spreadsheet::readMsWorksStyle(), and WPS8TextStyle::readParagraph().
static WPSColor WPSColor::black | ( | ) | [inline, static] |
return the back color
Referenced by LotusStyleManagerInternal::ColorStyle::ColorStyle(), WPSGraphicStyle::Pattern::Pattern(), QuattroSpreadsheet::readCellProperty(), QuattroSpreadsheet::readCellStyle(), LotusStyleManager::readLineStyle(), WPS8Table::readMCLD(), WKS4Spreadsheet::readMsWorksStyle(), WPS8TextStyle::readParagraph(), QuattroSpreadsheet::readUserStyle(), LotusStyleManager::updateSurfaceStyle(), and WPSGraphicStyle::WPSGraphicStyle().
unsigned char WPSColor::getAlpha | ( | ) | const [inline] |
returns the alpha value
unsigned char WPSColor::getBlue | ( | ) | const [inline] |
returns the green value
unsigned char WPSColor::getGreen | ( | ) | const [inline] |
returns the green value
unsigned char WPSColor::getRed | ( | ) | const [inline] |
returns the red value
bool WPSColor::isBlack | ( | ) | const [inline] |
return true if the color is black
Referenced by operator<<().
bool WPSColor::isWhite | ( | ) | const [inline] |
return true if the color is white
Referenced by WPSParagraph::addTo(), LotusSpreadsheetInternal::Style::isVisible(), WPS8ParserInternal::operator<<(), WPS4TextInternal::operator<<(), operator<<(), and LotusStyleManager::readLineStyle().
bool WPSColor::operator!= | ( | WPSColor const & | c | ) | const [inline] |
operator!=
bool WPSColor::operator< | ( | WPSColor const & | c | ) | const [inline] |
operator<
Referenced by operator>=().
bool WPSColor::operator<= | ( | WPSColor const & | c | ) | const [inline] |
operator<=
Referenced by operator>().
WPSColor& WPSColor::operator= | ( | uint32_t | argb | ) | [inline] |
operator=
bool WPSColor::operator== | ( | WPSColor const & | c | ) | const [inline] |
operator==
Referenced by operator!=().
bool WPSColor::operator> | ( | WPSColor const & | c | ) | const [inline] |
operator>
bool WPSColor::operator>= | ( | WPSColor const & | c | ) | const [inline] |
operator>=
std::string WPSColor::str | ( | ) | const |
print the color in the form #rrggbb
Referenced by WPSGraphicStyle::addFrameTo(), WPSFont::addTo(), WPSParagraph::addTo(), WPSGraphicStyle::addTo(), and WPSBorder::addTo().
uint32_t WPSColor::value | ( | ) | const [inline] |
return the rgba value
static WPSColor WPSColor::white | ( | ) | [inline, static] |
std::ostream& operator<< | ( | std::ostream & | o, |
WPSColor const & | c | ||
) | [friend] |
operator<< in the form #rrggbb
uint32_t WPSColor::m_value [protected] |
the argb color
Referenced by barycenter(), getAlpha(), getBlue(), getGreen(), getRed(), isBlack(), isWhite(), operator<(), operator<<(), operator<=(), operator=(), operator==(), and value().