the class to store a color More...
#include <libmwaw_internal.hxx>
Public Member Functions | |
MWAWColor (uint32_t argb=0) | |
constructor | |
MWAWColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) | |
constructor from color | |
MWAWColor (MWAWColor const &)=default | |
copy constructor | |
MWAWColor (MWAWColor &&)=default | |
move assignement | |
MWAWColor & | operator= (MWAWColor const &)=default |
operator= | |
MWAWColor & | operator= (MWAWColor &&)=default |
move operator= | |
MWAWColor & | 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== (MWAWColor const &c) const |
operator== | |
bool | operator!= (MWAWColor const &c) const |
operator!= | |
bool | operator< (MWAWColor const &c) const |
operator< | |
bool | operator<= (MWAWColor const &c) const |
operator<= | |
bool | operator> (MWAWColor const &c) const |
operator> | |
bool | operator>= (MWAWColor const &c) const |
operator>= | |
std::string | str () const |
print the color in the form #rrggbb | |
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) | |
static MWAWColor | colorFromHSL (unsigned char H, unsigned char S, unsigned char L) |
return a color from a hsl color (basic) | |
static MWAWColor | black () |
return the back color | |
static MWAWColor | white () |
return the white color | |
static MWAWColor | barycenter (float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB) |
return alpha*colA+beta*colB | |
Protected Attributes | |
uint32_t | m_value |
the argb color | |
Friends | |
std::ostream & | operator<< (std::ostream &o, MWAWColor const &c) |
operator<< in the form #rrggbb | |
the class to store a color
|
inlineexplicit |
constructor
|
inline |
constructor from color
|
default |
copy constructor
|
default |
move assignement
|
static |
return alpha*colA+beta*colB
Referenced by MWAWGraphicStyle::Pattern::getAverageColor(), MarinerWrtTextInternal::Paragraph::BorderFill::getBackgroundColor(), RagTime5StyleManager::getCellBackgroundColor(), RagTime5StyleManager::getCellBorder(), MacWrtProStructures::getColor(), CricketDrawParserInternal::State::getColor(), HanMacWrdJGraphInternal::State::getColor(), HanMacWrdKGraphInternal::State::getColor(), RagTime5StyleManager::getLineColor(), FreeHandParser::readColor(), RagTimeParser::readColorTable(), RagTimeParser::readDataZoneHeader(), LightWayTxtText::readFont2(), PowerPoint3Parser::readFramesList(), MacDrawProParser::readObject(), MsWksGraph::readPictHeader(), CricketDrawParser::readShape(), ReadySetGoGraph::readShapeV6(), WingzParser::readSpreadsheetStyle(), ReadySetGoStyleManager::readStyle(), CanvasGraph::sendMultiLines(), MarinerWrtGraph::sendRule(), CanvasGraph::update(), RagTime5StyleManager::updateBorderStyle(), RagTime5StyleManager::updateFrameStyle(), ClarisDrawStyleManager::updateGradient(), ClarisWksStyleManager::updateGradient(), and Canvas5StyleManager::updateLine().
|
inlinestatic |
return the back color
Referenced by RagTimeParser::createZones(), MacDraft5StyleManagerInternal::Pixmap::get(), MWAWPictBitmapBW::getAverageColor(), MWAWPictBitmapIndexed::getAverageColor(), MWAWPictBitmapColor::getAverageColor(), DrawTableParser::getBitmap(), DrawTableParserInternal::State::getColor(), CricketDrawParserInternal::State::getColor(), BeagleWksSSParserInternal::State::getColor(), MWAWGraphicStyle::Gradient::Gradient(), ClarisDrawStyleManagerInternal::Gradient::Gradient(), ClarisWksStyleManagerInternal::Gradient::Gradient(), RagTime5StyleManager::GraphicStyle::GraphicStyle(), ClarisDrawStyleManagerInternal::State::initBWPatterns(), MacDrawProStyleManagerInternal::State::initBWPatterns(), MacDrawProStyleManagerInternal::State::initColors(), RagTime5StyleManagerInternal::State::initColorsList(), DrawTableParserInternal::State::initPatterns(), MacDraft5StyleManagerInternal::State::initPatterns(), MacDraftParserInternal::State::initPatterns(), MacDrawParserInternal::State::initPatterns(), WingzGraphInternal::State::initPatterns(), MWAWGraphicStyle::Pattern::Pattern(), MarinerWrtGraphInternal::Pattern::Pattern(), ClarisWksStyleManagerInternal::Pattern::Pattern(), HanMacWrdJGraphInternal::Pattern::Pattern(), HanMacWrdKGraphInternal::Pattern::Pattern(), RagTimeParserInternal::Pattern::Pattern(), Canvas5StyleManagerInternal::PenStyle::PenStyle(), RagTime5StyleManager::GraphicStyle::read(), BeagleWksBMParser::readBitmap(), MacPaintParser::readBitmap(), SuperPaintParser::readBitmap(), ScoopParser::readBitmap(), Canvas5Structure::readBitmap(), ApplePictParser::readBWPattern(), MacDrawProStyleManager::readBWPatterns(), libmwaw_applepict1::OpCode::readColor(), ApplePictParser::readColorPattern(), MacDrawProStyleManager::readColorPatterns(), RagTime5Graph::readColorPatternZone(), RagTimeParser::readDataZoneHeader(), FreeHandParser::readFillStyle(), ClarisWksStyleManager::readFont(), MsWrdTextStyles::readFont(), LightWayTxtText::readFont2(), ClarisWksStyleManager::readFontAndPos(), HanMacWrdJGraph::readFrames(), PowerPoint3Parser::readFramesList(), PowerPoint1Parser::readFramesList(), FreeHandParser::readLineStyle(), MacDrawProParser::readObject(), MacDraftParser::readPattern(), ClarisDrawStyleManager::readPatternList(), MacDrawProStyleManager::readPatternMap(), MacDraft5StyleManager::readPatterns(), SuperPaintParser::readShape(), ReadySetGoGraph::readShapeDSV2(), ReadySetGoGraph::readShapeV3(), ReadySetGoGraph::readShapeV6(), PowerPoint7Graph::readStyle(), GreatWksGraph::readStyle(), HanMacWrdKGraph::readTable(), HanMacWrdJGraph::readTableFormatsList(), PowerPoint7Text::readTextZone(), CanvasParser::readUnknownZone0(), ApplePictParser::readZone(), MarinerWrtTextInternal::Paragraph::BorderFill::resetBackgroundColor(), MWAWFont::resetColor(), MacDrawProParser::send(), MacDraftParser::sendBitmap(), MacDrawParser::sendBitmap(), MacDrawProParser::sendBitmap(), ClarisDrawGraph::sendGroup(), ClarisDrawGraph::sendMainGroupChild(), CanvasGraph::sendMultiLines(), and StudentWritingCParser::sendText().
|
inlinestatic |
return a color from a cmyk color ( basic)
Referenced by Canvas5StyleManager::readColor(), FreeHandParser::readColor(), MacDrawProStyleManager::readColorMap(), MacDrawProStyleManager::readColorPalette(), and MacDrawProStyleManager::readGradientPalette().
|
inlinestatic |
return a color from a hsl color (basic)
Referenced by MacDrawProStyleManager::readColorMap(), and MacDrawProStyleManager::readColorPalette().
|
inline |
returns the alpha value
Referenced by MWAWPictBitmapColor::getAverageColor(), Canvas5StyleManager::updateLineColor(), and Canvas5StyleManager::updateSurfaceColor().
|
inline |
returns the green value
Referenced by MacDraft5StyleManagerInternal::Pixmap::get(), MWAWPictBitmapColor::getAverageColor(), RagTime5StyleManager::getCellBackgroundColor(), RagTime5StyleManager::getCellBorder(), MacDrawProStyleManager::readColorPatterns(), MacDrawProParser::readObject(), and RagTime5StyleManager::updateBorderStyle().
|
inline |
returns the green value
Referenced by MacDraft5StyleManagerInternal::Pixmap::get(), MWAWPictBitmapColor::getAverageColor(), RagTime5StyleManager::getCellBackgroundColor(), RagTime5StyleManager::getCellBorder(), MacDrawProStyleManager::readColorPatterns(), and RagTime5StyleManager::updateBorderStyle().
|
inline |
returns the red value
Referenced by MacDraft5StyleManagerInternal::Pixmap::get(), MWAWPictBitmapColor::getAverageColor(), MWAWGraphicStyle::Gradient::getAverageColor(), RagTime5StyleManager::getCellBackgroundColor(), RagTime5StyleManager::getCellBorder(), MacDrawProStyleManager::readColorPatterns(), and RagTime5StyleManager::updateBorderStyle().
|
inline |
return true if the color is black
Referenced by MarinerWrtTextInternal::Paragraph::BorderFill::hasBackgroundColor(), MWAWFont::hasColor(), WingzGraph::readChartData(), MarinerWrtParser::readDocInfo(), MoreParser::readDocumentInfo(), WingzGraph::readGraphic(), GreatWksDocument::readGrDS(), MacDrawProParser::readObject(), PowerPoint3Parser::readParagraph(), CricketDrawParser::readShape(), SuperPaintParser::readShape(), PowerPoint7Graph::readStyle(), GreatWksSSParser::readStyles(), PowerPoint7Text::readTextZone(), MarinerWrtGraph::readToken(), CorelPainterParser::sendText(), PowerPoint1Parser::sendText(), and MacDraft5StyleManager::updateLineStyle().
|
inline |
return true if the color is white
Referenced by MWAWSection::addTo(), MWAWParagraph::addTo(), MWAWFont::addTo(), FullWrtStruct::Border::addTo(), MacWrtProStructuresInternal::Graphic::fillFrame(), MsWksGraphInternal::TextBox::fillFrame(), MsWksGraphInternal::TextBoxv4::fillFrame(), MWAWFont::getDebugString(), MWAWPageSpan::getPageProperty(), MarinerWrtTextInternal::Paragraph::BorderFill::hasBackgroundColor(), MacWrtProStructuresInternal::Graphic::hasBorders(), WingzGraph::readChartData(), RagTimeParser::readDataZoneHeader(), MoreParser::readDocumentInfo(), WingzGraph::readGraphic(), GreatWksDocument::readGrDS(), MacDrawProParser::readObject(), CorelPainterParser::readResource(), CricketDrawParser::readShape(), SuperPaintParser::readShape(), WingzParser::readSpreadsheetStyle(), GreatWksSSParser::readStyles(), MarinerWrtParser::readZone13(), ClarisWksSpreadsheet::sendSpreadsheet(), MsWrdText::sendTable(), MacDraft5StyleManager::updateSurfaceStyle(), and FullWrtTextInternal::Paragraph::updateToSent().
|
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 MWAWColor::str | ( | ) | const |
print the color in the form #rrggbb
Referenced by MWAWGraphicStyle::addFrameTo(), MWAWGraphicStyle::addTo(), MWAWSection::addTo(), MWAWParagraph::addTo(), MWAWFont::addTo(), MWAWFont::Line::addTo(), MWAWFont::addToListLevel(), MWAWPageSpan::getPageProperty(), MoreParser::readBackside(), Canvas5Structure::readBitmap(), WingzGraph::readChartData(), PowerPoint3Parser::readFramesList(), CanvasStyleManager::readGradient(), HanMacWrdKGraph::readTable(), CricketDrawParser::sendBitmap(), and CanvasGraph::sendMultiLines().
|
inline |
return the rgba value
Referenced by MWAWPictBitmapInternal::getBMPData(), MWAWPictBitmapInternal::getPPMData(), and CorelPainterParser::sendText().
|
inlinestatic |
return the white color
Referenced by DrawTableParser::getBitmap(), CanvasGraph::getBitmapBW(), MacWrtProStructures::getColor(), DrawTableParserInternal::State::getColor(), CricketDrawParserInternal::State::getColor(), BeagleWksSSParserInternal::State::getColor(), HanMacWrdJGraphInternal::State::getColor(), HanMacWrdKGraphInternal::State::getColor(), BeagleWksTextInternal::Font::getFont(), RagTime5StyleManager::getLineColor(), MWAWGraphicStyle::Gradient::Gradient(), ClarisDrawStyleManagerInternal::Gradient::Gradient(), ClarisWksStyleManagerInternal::Gradient::Gradient(), RagTime5StyleManager::GraphicStyle::GraphicStyle(), ClarisDrawStyleManagerInternal::State::initBWPatterns(), MacDrawProStyleManagerInternal::State::initBWPatterns(), MacDrawProStyleManagerInternal::State::initColors(), RagTime5StyleManagerInternal::State::initColorsList(), DrawTableParserInternal::State::initPatterns(), MacDraft5StyleManagerInternal::State::initPatterns(), MacDraftParserInternal::State::initPatterns(), MacDrawParserInternal::State::initPatterns(), WingzGraphInternal::State::initPatterns(), MWAWGraphicStyle::Pattern::Pattern(), MarinerWrtGraphInternal::Pattern::Pattern(), ClarisWksStyleManagerInternal::Pattern::Pattern(), HanMacWrdJGraphInternal::Pattern::Pattern(), HanMacWrdKGraphInternal::Pattern::Pattern(), RagTimeParserInternal::Pattern::Pattern(), RagTime5StyleManager::GraphicStyle::read(), BeagleWksBMParser::readBitmap(), MacPaintParser::readBitmap(), SuperPaintParser::readBitmap(), ScoopParser::readBitmap(), Canvas5Structure::readBitmap(), 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(), PowerPoint3Parser::readFramesList(), PowerPoint1Parser::readFramesList(), MacWrtProStructures::readGraphic(), MacDraftParser::readLabel(), FreeHandParser::readLineStyle(), MacDrawProParser::readObject(), MacDraftParser::readPattern(), ClarisDrawStyleManager::readPatternList(), MacDrawProStyleManager::readPatternMap(), MacDraft5StyleManager::readPatterns(), CricketDrawParser::readShape(), ReadySetGoGraph::readShapeDSV2(), ReadySetGoGraph::readShapeV3(), ReadySetGoGraph::readShapeV6(), BeagleWksDRParser::readStyle(), PowerPoint7Graph::readStyle(), ReadySetGoStyleManager::readStyle(), GreatWksGraph::readStyle(), HanMacWrdKGraph::readTable(), HanMacWrdJGraph::readTableFormatsList(), ApplePictParser::readZone(), MarinerWrtTextInternal::Paragraph::BorderFill::resetBackgroundColor(), MWAWFont::resetColor(), CanvasGraph::send(), MacDrawProParser::send(), Canvas5Graph::send(), CricketDrawParser::sendBitmap(), CanvasGraph::sendDimension(), Canvas5Graph::sendDimension(), CanvasGraph::sendMultiLines(), BeagleWksDRParser::sendPictures(), MarinerWrtGraph::sendRule(), ClarisDrawGraph::sendShape(), FreeHandParserInternal::State::updateFillStyle(), FreeHandParserInternal::State::updateLineStyle(), and RagTime5StyleManager::updateSurfaceStyle().
|
friend |
operator<< in the form #rrggbb
|
protected |
the argb color
Referenced by barycenter(), getAlpha(), getBlue(), getGreen(), getRed(), isBlack(), isWhite(), operator<(), operator<=(), operator=(), operator==(), and value().