MWAWColor Struct Reference documentation

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

the class to store a color More...

`#include <libmwaw_internal.hxx>`

## Public Member Functions
| MWAWColor (uint32_t argb=0)
| constructor More...
| MWAWColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
| constructor from color More...
| MWAWColor (MWAWColor const &)=default
| copy constructor More...
| MWAWColor (MWAWColor &&)=default
| move assignement More...
MWAWColor & | operator= (MWAWColor const &)=default
| operator= More...
MWAWColor & | operator= (MWAWColor &&)=default
| move operator= More...
MWAWColor & | 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== (MWAWColor const &c) const
| operator== More...
bool | operator!= (MWAWColor const &c) const
| operator!= More...
bool | operator< (MWAWColor const &c) const
| operator< More...
bool | operator<= (MWAWColor const &c) const
| operator<= More...
bool | operator> (MWAWColor const &c) const
| operator> More...
bool | operator>= (MWAWColor const &c) const
| operator>= More...
std::string | str () const
| print the color in the form #rrggbb More...

## Static Public Member Functions
static MWAWColor | colorFromCMYK (unsigned char c, unsigned char m, unsigned char y, unsigned char k)
| return a color from a cmyk color ( basic) More...
static MWAWColor | colorFromHSL (unsigned char H, unsigned char S, unsigned char L)
| return a color from a hsl color (basic) More...
static MWAWColor | black ()
| return the back color More...
static MWAWColor | white ()
| return the white color More...
static MWAWColor | barycenter (float alpha, MWAWColor const &colA, float beta, MWAWColor 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, MWAWColor const &c)
| operator<< in the form #rrggbb More...

## Detailed Description

the class to store a color

## Constructor & Destructor Documentation

## ◆ MWAWColor() [1/4]

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

constructor

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

## ◆ MWAWColor() [2/4]

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

constructor from color

## ◆ MWAWColor() [3/4]

MWAWColor::MWAWColor | ( | MWAWColor const & |  | ) |
| default

copy constructor

## ◆ MWAWColor() [4/4]

MWAWColor::MWAWColor | ( | MWAWColor && |  | ) |
| default

move assignement

## Member Function Documentation

## ◆ barycenter()

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

return alpha*colA+beta*colB

Referenced by MWAWGraphicStyle::Pattern::getAverageColor(), MarinerWrtTextInternal::Paragraph::BorderFill::getBackgroundColor(), RagTime5StyleManager::getCellBackgroundColor(), RagTime5StyleManager::getCellBorder(), CricketDrawParserInternal::State::getColor(), MacWrtProStructures::getColor(), HanMacWrdKGraphInternal::State::getColor(), HanMacWrdJGraphInternal::State::getColor(), RagTime5StyleManager::getLineColor(), FreeHandParser::readColor(), RagTimeParser::readColorTable(), RagTimeParser::readDataZoneHeader(), LightWayTxtText::readFont2(), PowerPoint3Parser::readFramesList(), MacDrawProParser::readObject(), MsWksGraph::readPictHeader(), CricketDrawParser::readShape(), WingzParser::readSpreadsheetStyle(), MarinerWrtGraph::sendRule(), RagTime5StyleManager::updateBorderStyle(), ClarisDrawStyleManager::updateGradient(), and ClarisWksStyleManager::updateGradient().

## ◆ black()

static MWAWColor MWAWColor::black | ( |  | ) |
| inlinestatic

return the back color

Referenced by RagTimeParser::createZones(), MacDraft5StyleManagerInternal::Pixmap::get(), CricketDrawParserInternal::State::getColor(), BeagleWksSSParserInternal::State::getColor(), ClarisDrawStyleManagerInternal::Gradient::Gradient(), ClarisWksStyleManagerInternal::Gradient::Gradient(), RagTime5StyleManager::GraphicStyle::GraphicStyle(), MacDrawProStyleManagerInternal::State::initBWPatterns(), ClarisDrawStyleManagerInternal::State::initBWPatterns(), MacDrawProStyleManagerInternal::State::initColors(), RagTime5StyleManagerInternal::State::initColorsList(), MacDrawParserInternal::State::initPatterns(), MacDraftParserInternal::State::initPatterns(), MacDraft5StyleManagerInternal::State::initPatterns(), MWAWGraphicStyle::MWAWGraphicStyle(), ClarisWksStyleManagerInternal::Pattern::Pattern(), RagTimeParserInternal::Pattern::Pattern(), MarinerWrtGraphInternal::Pattern::Pattern(), MWAWGraphicStyle::Pattern::Pattern(), HanMacWrdKGraphInternal::Pattern::Pattern(), HanMacWrdJGraphInternal::Pattern::Pattern(), RagTime5StyleManager::GraphicStyle::read(), MacPaintParser::readBitmap(), SuperPaintParser::readBitmap(), BeagleWksBMParser::readBitmap(), ApplePictParser::readBWPattern(), MacDrawProStyleManager::readBWPatterns(), libmwaw_applepict1::OpCode::readColor(), ApplePictParser::readColorPattern(), MacDrawProStyleManager::readColorPatterns(), RagTime5Graph::readColorPatternZone(), RagTimeParser::readDataZoneHeader(), FreeHandParser::readFillStyle(), MsWrdTextStyles::readFont(), ClarisWksStyleManager::readFont(), LightWayTxtText::readFont2(), ClarisWksStyleManager::readFontAndPos(), HanMacWrdJGraph::readFrames(), PowerPoint1Parser::readFramesList(), PowerPoint3Parser::readFramesList(), FreeHandParser::readLineStyle(), MacDrawProParser::readObject(), MacDraftParser::readPattern(), ClarisDrawStyleManager::readPatternList(), MacDrawProStyleManager::readPatternMap(), MacDraft5StyleManager::readPatterns(), SuperPaintParser::readShape(), PowerPoint7Graph::readStyle(), GreatWksGraph::readStyle(), HanMacWrdKGraph::readTable(), HanMacWrdJGraph::readTableFormatsList(), PowerPoint7Text::readTextZone(), ApplePictParser::readZone(), MarinerWrtTextInternal::Paragraph::BorderFill::resetBackgroundColor(), MWAWFont::resetColor(), MacDrawProParser::send(), MacDrawParser::sendBitmap(), MacDraftParser::sendBitmap(), MacDrawProParser::sendBitmap(), ClarisDrawGraph::sendGroup(), and ClarisDrawGraph::sendMainGroupChild().

## ◆ colorFromCMYK()

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

return a color from a cmyk color ( basic)

Referenced by FreeHandParser::readColor(), MacDrawProStyleManager::readColorMap(), MacDrawProStyleManager::readColorPalette(), and MacDrawProStyleManager::readGradientPalette().

## ◆ colorFromHSL()

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

return a color from a hsl color (basic)

Referenced by MacDrawProStyleManager::readColorMap(), and MacDrawProStyleManager::readColorPalette().

## ◆ getAlpha()

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

returns the alpha value

## ◆ getBlue()

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

returns the green value

Referenced by MacDraft5StyleManagerInternal::Pixmap::get(), RagTime5StyleManager::getCellBackgroundColor(), RagTime5StyleManager::getCellBorder(), MacDrawProStyleManager::readColorPatterns(), MacDrawProParser::readObject(), and RagTime5StyleManager::updateBorderStyle().

## ◆ getGreen()

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

returns the green value

Referenced by MacDraft5StyleManagerInternal::Pixmap::get(), RagTime5StyleManager::getCellBackgroundColor(), RagTime5StyleManager::getCellBorder(), MacDrawProStyleManager::readColorPatterns(), and RagTime5StyleManager::updateBorderStyle().

## ◆ getRed()

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

returns the red value

Referenced by MacDraft5StyleManagerInternal::Pixmap::get(), RagTime5StyleManager::getCellBackgroundColor(), RagTime5StyleManager::getCellBorder(), MacDrawProStyleManager::readColorPatterns(), and RagTime5StyleManager::updateBorderStyle().

## ◆ isBlack()

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

return true if the color is black

Referenced by MarinerWrtTextInternal::Paragraph::BorderFill::hasBackgroundColor(), MWAWFont::hasColor(), RagTimeParserInternal::operator<<(), MarinerWrtGraphInternal::operator<<(), FullWrtStruct::operator<<(), MarinerWrtTextInternal::operator<<(), operator<<(), MoreStruct::operator<<(), MarinerWrtParser::readDocInfo(), MoreParser::readDocumentInfo(), GreatWksDocument::readGrDS(), MacDrawProParser::readObject(), PowerPoint3Parser::readParagraph(), CricketDrawParser::readShape(), SuperPaintParser::readShape(), PowerPoint7Graph::readStyle(), GreatWksSSParser::readStyles(), PowerPoint7Text::readTextZone(), MarinerWrtGraph::readToken(), and MacDraft5StyleManager::updateLineStyle().

## ◆ isWhite()

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

return true if the color is white

Referenced by FullWrtStruct::Border::addTo(), MWAWSection::addTo(), MWAWParagraph::addTo(), MWAWFont::addTo(), MacWrtProStructuresInternal::Block::fillFrame(), MsWksGraphInternal::TextBox::fillFrame(), MsWksGraphInternal::TextBoxv4::fillFrame(), MWAWFont::getDebugString(), MWAWPageSpan::getPageProperty(), MarinerWrtTextInternal::Paragraph::BorderFill::hasBackgroundColor(), MacWrtProStructuresInternal::Block::hasBorders(), MarinerWrtParserInternal::operator<<(), FullWrtStruct::operator<<(), MarinerWrtTextInternal::operator<<(), operator<<(), MoreStruct::operator<<(), RagTimeParser::readDataZoneHeader(), MoreParser::readDocumentInfo(), GreatWksDocument::readGrDS(), MacDrawProParser::readObject(), CricketDrawParser::readShape(), SuperPaintParser::readShape(), WingzParser::readSpreadsheetStyle(), GreatWksSSParser::readStyles(), MarinerWrtParser::readZone13(), ClarisWksSpreadsheet::sendSpreadsheet(), MsWrdText::sendTable(), MacDraft5StyleManager::updateSurfaceStyle(), and FullWrtTextInternal::Paragraph::updateToSent().

## ◆ operator!=()

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

operator!=

## ◆ operator<()

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

operator<

Referenced by operator>=().

## ◆ operator<=()

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

operator<=

Referenced by operator>().

## ◆ operator=() [1/3]

MWAWColor& MWAWColor::operator= | ( | MWAWColor const & |  | ) |
| default

operator=

## ◆ operator=() [2/3]

MWAWColor& MWAWColor::operator= | ( | MWAWColor && |  | ) |
| default

move operator=

## ◆ operator=() [3/3]

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

operator=

## ◆ operator==()

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

operator==

Referenced by operator!=().

## ◆ operator>()

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

operator>

## ◆ operator>=()

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

operator>=

## ◆ str()

std::string MWAWColor::str | ( |  | ) | const

print the color in the form #rrggbb

Referenced by MWAWGraphicStyle::addFrameTo(), MWAWFont::Line::addTo(), MWAWSection::addTo(), MWAWParagraph::addTo(), MWAWGraphicStyle::addTo(), MWAWFont::addTo(), MWAWFont::addToListLevel(), MWAWPageSpan::getPageProperty(), MoreParser::readBackside(), PowerPoint3Parser::readFramesList(), HanMacWrdKGraph::readTable(), and CricketDrawParser::sendBitmap().

## ◆ value()

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

return the rgba value

Referenced by MWAWPictBitmapInternal::getBMPData(), and MWAWPictBitmapInternal::getPPMData().

## ◆ white()

static MWAWColor MWAWColor::white | ( |  | ) |
| inlinestatic

return the white color

Referenced by CricketDrawParserInternal::State::getColor(), BeagleWksSSParserInternal::State::getColor(), MacWrtProStructures::getColor(), HanMacWrdKGraphInternal::State::getColor(), HanMacWrdJGraphInternal::State::getColor(), BeagleWksTextInternal::Font::getFont(), RagTime5StyleManager::getLineColor(), ClarisDrawStyleManagerInternal::Gradient::Gradient(), ClarisWksStyleManagerInternal::Gradient::Gradient(), RagTime5StyleManager::GraphicStyle::GraphicStyle(), MacDrawProStyleManagerInternal::State::initBWPatterns(), ClarisDrawStyleManagerInternal::State::initBWPatterns(), MacDrawProStyleManagerInternal::State::initColors(), RagTime5StyleManagerInternal::State::initColorsList(), MacDrawParserInternal::State::initPatterns(), MacDraftParserInternal::State::initPatterns(), MacDraft5StyleManagerInternal::State::initPatterns(), MWAWGraphicStyle::MWAWGraphicStyle(), ClarisWksStyleManagerInternal::Pattern::Pattern(), RagTimeParserInternal::Pattern::Pattern(), MarinerWrtGraphInternal::Pattern::Pattern(), MWAWGraphicStyle::Pattern::Pattern(), HanMacWrdKGraphInternal::Pattern::Pattern(), HanMacWrdJGraphInternal::Pattern::Pattern(), RagTime5StyleManager::GraphicStyle::read(), MacPaintParser::readBitmap(), SuperPaintParser::readBitmap(), BeagleWksBMParser::readBitmap(), MacWrtProStructures::readBlock(), ApplePictParser::readBWPattern(), MacDrawProStyleManager::readBWPatterns(), FreeHandParser::readColor(), libmwaw_applepict1::OpCode::readColor(), ApplePictParser::readColorPattern(), MacDrawProStyleManager::readColorPatterns(), RagTime5Graph::readColorPatternZone(), RagTimeParser::readColorTable(), RagTimeParser::readDataZoneHeader(), FreeHandParser::readFillStyle(), LightWayTxtText::readFont2(), MacDrawProStyleManager::readFontStyles(), HanMacWrdJGraph::readFrames(), PowerPoint1Parser::readFramesList(), PowerPoint3Parser::readFramesList(), MacDraftParser::readLabel(), FreeHandParser::readLineStyle(), MacDrawProParser::readObject(), MacDraftParser::readPattern(), ClarisDrawStyleManager::readPatternList(), MacDrawProStyleManager::readPatternMap(), MacDraft5StyleManager::readPatterns(), CricketDrawParser::readShape(), BeagleWksDRParser::readStyle(), PowerPoint7Graph::readStyle(), GreatWksGraph::readStyle(), HanMacWrdKGraph::readTable(), HanMacWrdJGraph::readTableFormatsList(), ApplePictParser::readZone(), MarinerWrtTextInternal::Paragraph::BorderFill::resetBackgroundColor(), MWAWFont::resetColor(), MacDrawProParser::send(), CricketDrawParser::sendBitmap(), BeagleWksDRParser::sendPictures(), MarinerWrtGraph::sendRule(), ClarisDrawGraph::sendShape(), FreeHandParserInternal::State::updateFillStyle(), FreeHandParserInternal::State::updateLineStyle(), and RagTime5StyleManager::updateSurfaceStyle().

## Friends And Related Function Documentation

## ◆ operator<<

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

operator<< in the form #rrggbb

## Member Data Documentation

## ◆ m_value

uint32_t MWAWColor::m_value
| protected

the argb color

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

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

- libmwaw_internal.hxx
- libmwaw_internal.cxx