STOFFColor Struct Reference documentation

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

the class to store a color More...

`#include <libstaroffice_internal.hxx>`

## Public Member Functions
| STOFFColor (uint32_t argb=0)
| constructor More...
| STOFFColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
| constructor from color More...
STOFFColor & | operator= (uint32_t argb)
| operator= More...
uint32_t | value () const
| return the rgba value More...
unsigned char | getAlpha () const
| returns the alpha value More...
void | setAlpha (unsigned char alpha)
| reset 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== (STOFFColor const &c) const
| operator== More...
bool | operator!= (STOFFColor const &c) const
| operator!= More...
bool | operator< (STOFFColor const &c) const
| operator< More...
bool | operator<= (STOFFColor const &c) const
| operator<= More...
bool | operator> (STOFFColor const &c) const
| operator> More...
bool | operator>= (STOFFColor const &c) const
| operator>= More...
std::string | str () const
| print the color in the form #rrggbb More...

## 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) More...
static STOFFColor | colorFromHSL (unsigned char H, unsigned char S, unsigned char L)
| return a color from a hsl color (basic) More...
static STOFFColor | black ()
| return the back color More...
static STOFFColor | white ()
| return the white color More...
static STOFFColor | barycenter (float alpha, STOFFColor const &colA, float beta, STOFFColor 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, STOFFColor const &c)
| operator<< in the form #rrggbb More...

## Detailed Description

the class to store a color

## Constructor & Destructor Documentation

## ◆ STOFFColor() [1/2]

STOFFColor::STOFFColor | ( | uint32_t | argb = `0` | ) |
| inlineexplicit

constructor

Referenced by barycenter(), black(), colorFromCMYK(), colorFromHSL(), and white().

## ◆ STOFFColor() [2/2]

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

constructor from color

## Member Function Documentation

## ◆ barycenter()

STOFFColor STOFFColor::barycenter | ( | float | alpha,
|  | STOFFColor const & | colA,
|  | float | beta,
|  | STOFFColor const & | colB
| ) |  |
| static

return alpha*colA+beta*colB

Referenced by StarGraphicStruct::StarBrush::getColor().

## ◆ black()

static STOFFColor STOFFColor::black | ( |  | ) |
| inlinestatic

return the back color

Referenced by StarCharAttribute::addInitTo(), and StarGraphicAttribute::addInitTo().

## ◆ colorFromCMYK()

static STOFFColor STOFFColor::colorFromCMYK | ( | unsigned char | c,
|  | unsigned char | m,
|  | unsigned char | y,
|  | unsigned char | k
| ) |  |
| inlinestatic

return a color from a cmyk color ( basic)

## ◆ colorFromHSL()

static STOFFColor STOFFColor::colorFromHSL | ( | unsigned char | H,
|  | unsigned char | S,
|  | unsigned char | L
| ) |  |
| inlinestatic

return a color from a hsl color (basic)

## ◆ getAlpha()

unsigned char STOFFColor::getAlpha | ( |  | ) | const
| inline

returns the alpha value

## ◆ getBlue()

unsigned char STOFFColor::getBlue | ( |  | ) | const
| inline

returns the green value

## ◆ getGreen()

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

returns the green value

## ◆ getRed()

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

returns the red value

## ◆ isBlack()

bool STOFFColor::isBlack | ( |  | ) | const
| inline

return true if the color is black

Referenced by STOFFFont::addTo(), StarPageAttribute::StarPAttributeColumns::printData(), StarAttributeManager::readAttribute(), StarObjectNumericRuler::readAttributeLevel(), and StarFileManager::readSVGDI().

## ◆ isWhite()

bool STOFFColor::isWhite | ( |  | ) | const
| inline

return true if the color is white

Referenced by StarFrameAttribute::StarFAttributeShadow::printData(), and StarObjectChart::readSCHAttributes().

## ◆ operator!=()

bool STOFFColor::operator!= | ( | STOFFColor const & | c | ) | const
| inline

operator!=

## ◆ operator<()

bool STOFFColor::operator< | ( | STOFFColor const & | c | ) | const
| inline

operator<

Referenced by operator>=().

## ◆ operator<=()

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

operator<=

Referenced by operator>().

## ◆ operator=()

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

operator=

## ◆ operator==()

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

operator==

Referenced by operator!=().

## ◆ operator>()

bool STOFFColor::operator> | ( | STOFFColor const & | c | ) | const
| inline

operator>

## ◆ operator>=()

bool STOFFColor::operator>= | ( | STOFFColor const & | c | ) | const
| inline

operator>=

## ◆ setAlpha()

void STOFFColor::setAlpha | ( | unsigned char | alpha | ) |
| inline

reset the alpha value

## ◆ str()

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().

## ◆ value()

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

return the rgba value

Referenced by StarGraphicStruct::getBMPData().

## ◆ white()

static STOFFColor STOFFColor::white | ( |  | ) |
| inlinestatic

return the white color

Referenced by StarGraphicAttribute::addInitTo(), and StarObjectSmallGraphicInternal::SDUDGraphicAnimation::SDUDGraphicAnimation().

## Friends And Related Function Documentation

## ◆ operator<<

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

operator<< in the form #rrggbb

## Member Data Documentation

## ◆ m_value

uint32_t STOFFColor::m_value
| protected

the argb color

Referenced by barycenter(), getAlpha(), getBlue(), getGreen(), getRed(), isBlack(), isWhite(), operator<(), operator<=(), operator=(), operator==(), setAlpha(), and value().

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

- libstaroffice_internal.hxx
- libstaroffice_internal.cxx