- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
WPSColor Struct Reference

the class to store a color More...

`#include <libwps_internal.h>`

## Public Member Functions
| WPSColor (uint32_t argb=0)
| constructor More...
| WPSColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
| constructor from color More...
WPSColor & | operator= (uint32_t argb)
| operator= More...
uint32_t | value () const
| return the rgba value More...
unsigned char | getAlpha () const
| returns the alpha value More...
unsigned char | getBlue () const
| returns the green value More...
unsigned char | getRed () const
| returns the red value More...
unsigned char | getGreen () const
| returns the green value More...
bool | isBlack () const
| return true if the color is black More...
bool | isWhite () const
| return true if the color is white More...
bool | operator== (WPSColor const &c) const
| operator== More...
bool | operator!= (WPSColor const &c) const
| operator!= More...
bool | operator< (WPSColor const &c) const
| operator< More...
bool | operator<= (WPSColor const &c) const
| operator<= More...
bool | operator> (WPSColor const &c) const
| operator> More...
bool | operator>= (WPSColor const &c) const
| operator>= More...
std::string | str () const
| print the color in the form #rrggbb More...

## Static Public Member Functions
static WPSColor | black ()
| return the back color More...
static WPSColor | white ()
| return the white color More...
static WPSColor | barycenter (float alpha, WPSColor const &colA, float beta, WPSColor const &colB)
| return alpha*colA+beta*colB More...

## Protected Attributes
uint32_t | m_value
| the argb color More...

## Friends
std::ostream & | operator<< (std::ostream &o, WPSColor const &c)
| operator<< in the form #rrggbb More...

## Detailed Description

the class to store a color

## Constructor & Destructor Documentation

WPSColor::WPSColor | ( | uint32_t | argb = `0` | ) |
| inline explicit

constructor

WPSColor::WPSColor | ( | unsigned char | r,
|  | unsigned char | g,
|  | unsigned char | b,
|  | unsigned char | a = `255`
| ) |  |
| inline

constructor from color

## Member Function Documentation

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

Referenced by DosWordParser::readPAP().

unsigned char WPSColor::getGreen | ( |  | ) | const
| inline

returns the green value

Referenced by DosWordParser::readPAP().

unsigned char WPSColor::getRed | ( |  | ) | const
| inline

returns the red value

Referenced by DosWordParser::readPAP().

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 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<

bool WPSColor::operator<= | ( | WPSColor const & | c | ) | const
| inline

operator<=

WPSColor& WPSColor::operator= | ( | uint32_t | argb | ) |
| inline

operator=

bool WPSColor::operator== | ( | WPSColor const & | c | ) | const
| inline

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(), and WPSGraphicStyle::addTo().

uint32_t WPSColor::value | ( |  | ) | const
| inline

return the rgba value

Referenced by WPSGraphicStyle::Pattern::getBinary().

static WPSColor WPSColor::white | ( |  | ) |
| inline static

return the white color

Referenced by LotusStyleManagerInternal::ColorStyle::ColorStyle(), WPSGraphicStyle::Pattern::Pattern(), LotusStyleManager::readLineStyle(), WPS8Table::readMCLD(), WKS4Spreadsheet::readMsWorksStyle(), WPS8TextStyle::readParagraph(), and WPSGraphicStyle::WPSGraphicStyle().

## Friends And Related Function Documentation

std::ostream& operator<< | ( | std::ostream & | o,
|  | WPSColor const & | c
| ) |  |
| friend

operator<< in the form #rrggbb

## Member Data Documentation

uint32_t WPSColor::m_value
| protected

the argb color

Referenced by barycenter(), operator<(), operator<<(), operator<=(), and operator==().

The documentation for this struct was generated from the following files:

- libwps_internal.h
- libwps_internal.cpp