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 & | 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
| MWAWColor::MWAWColor | ( | uint32_t | argb = 0 | ) | [inline] |
constructor
Referenced by black(), colorFromCMYK(), colorFromHSL(), and white().
| MWAWColor::MWAWColor | ( | unsigned char | r, |
| unsigned char | g, | ||
| unsigned char | b, | ||
| unsigned char | a = 255 |
||
| ) | [inline] |
constructor from color
| 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(), MacWrtProStructures::getColor(), HanMacWrdKGraphInternal::State::getColor(), HanMacWrdJGraphInternal::State::getColor(), RagTimeParser::readColorTable(), RagTimeParser::readDataZoneHeader(), LightWayTxtText::readFont2(), MacDrawProParser::readObject(), MsWksGraph::readPictHeader(), WingzParser::readSpreadsheetStyle(), MarinerWrtGraph::sendRule(), ClarisDrawStyleManager::updateGradient(), and ClarisWksStyleManager::updateGradient().
| static MWAWColor MWAWColor::black | ( | ) | [inline, static] |
return the back color
Referenced by RagTimeParser::createZones(), BeagleWksSSParserInternal::State::getColor(), ClarisDrawStyleManagerInternal::Gradient::Gradient(), ClarisWksStyleManagerInternal::Gradient::Gradient(), RagTime5StructManager::GraphicStyle::GraphicStyle(), MacDrawProStyleManagerInternal::State::initBWPatterns(), ClarisDrawStyleManagerInternal::State::initBWPatterns(), MacDrawProStyleManagerInternal::State::initColors(), MacDrawParserInternal::State::initPatterns(), MacDraftParserInternal::State::initPatterns(), MWAWGraphicStyle::MWAWGraphicStyle(), ClarisWksStyleManagerInternal::Pattern::Pattern(), RagTimeParserInternal::Pattern::Pattern(), MarinerWrtGraphInternal::Pattern::Pattern(), MWAWGraphicStyle::Pattern::Pattern(), HanMacWrdKGraphInternal::Pattern::Pattern(), HanMacWrdJGraphInternal::Pattern::Pattern(), RagTime5StructManager::GraphicStyle::read(), MacPaintParser::readBitmap(), SuperPaintParser::readBitmap(), BeagleWksBMParser::readBitmap(), MacDrawProStyleManager::readBWPatterns(), libmwaw_applepict1::OpCode::readColor(), MacDrawProStyleManager::readColorPatterns(), RagTime5Graph::readColorPatternZone(), RagTimeParser::readDataZoneHeader(), MsWrdTextStyles::readFont(), ClarisWksStyleManager::readFont(), ClarisWksText::readFont(), LightWayTxtText::readFont2(), HanMacWrdJGraph::readFrames(), MacDrawProParser::readObject(), MacDraftParser::readPattern(), ClarisDrawStyleManager::readPatternList(), MacDrawProStyleManager::readPatternMap(), SuperPaintParser::readShape(), GreatWksGraph::readStyle(), HanMacWrdKGraph::readTable(), HanMacWrdJGraph::readTableFormatsList(), MarinerWrtTextInternal::Paragraph::BorderFill::resetBackgroundColor(), MWAWFont::resetColor(), MacDrawProParser::send(), MacDrawParser::sendBitmap(), MacDraftParser::sendBitmap(), MacDrawProParser::sendBitmap(), ClarisDrawGraph::sendGroup(), and ClarisDrawGraph::sendMainGroupChild().
| static MWAWColor MWAWColor::colorFromCMYK | ( | unsigned char | c, |
| unsigned char | m, | ||
| unsigned char | y, | ||
| unsigned char | k | ||
| ) | [inline, static] |
return a color from a cmyk color ( basic)
Referenced by MacDrawProStyleManager::readColorMap(), MacDrawProStyleManager::readColorPalette(), and MacDrawProStyleManager::readGradientPalette().
| static MWAWColor MWAWColor::colorFromHSL | ( | unsigned char | H, |
| unsigned char | S, | ||
| unsigned char | L | ||
| ) | [inline, static] |
return a color from a hsl color (basic)
Referenced by MacDrawProStyleManager::readColorMap(), and MacDrawProStyleManager::readColorPalette().
| unsigned char MWAWColor::getAlpha | ( | ) | const [inline] |
returns the alpha value
| unsigned char MWAWColor::getBlue | ( | ) | const [inline] |
returns the green value
Referenced by MacDrawProStyleManager::readColorPatterns(), and MacDrawProParser::readObject().
| unsigned char MWAWColor::getGreen | ( | ) | const [inline] |
returns the green value
Referenced by MacDrawProStyleManager::readColorPatterns().
| unsigned char MWAWColor::getRed | ( | ) | const [inline] |
returns the red value
Referenced by MacDrawProStyleManager::readColorPatterns().
| bool MWAWColor::isBlack | ( | ) | const [inline] |
return true if the color is black
Referenced by MarinerWrtTextInternal::Paragraph::BorderFill::hasBackgroundColor(), RagTime5StructManager::GraphicStyle::isDefault(), RagTimeParserInternal::operator<<(), MarinerWrtGraphInternal::operator<<(), FullWrtStruct::operator<<(), MarinerWrtTextInternal::operator<<(), operator<<(), MoreStruct::operator<<(), MarinerWrtParser::readDocInfo(), MoreParser::readDocumentInfo(), GreatWksDocument::readGrDS(), MacDrawProParser::readObject(), GreatWksSSParser::readStyles(), and MarinerWrtGraph::readToken().
| 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(), MWAWPageSpan::getPageProperty(), MarinerWrtTextInternal::Paragraph::BorderFill::hasBackgroundColor(), MacWrtProStructuresInternal::Block::hasBorders(), RagTime5StructManager::GraphicStyle::isDefault(), MarinerWrtParserInternal::operator<<(), FullWrtStruct::operator<<(), MarinerWrtTextInternal::operator<<(), operator<<(), MoreStruct::operator<<(), RagTimeParser::readDataZoneHeader(), MoreParser::readDocumentInfo(), GreatWksDocument::readGrDS(), MacDrawProParser::readObject(), WingzParser::readSpreadsheetCellList(), WingzParser::readSpreadsheetStyle(), GreatWksSSParser::readStyles(), MarinerWrtParser::readZone13(), ClarisDrawGraph::sendGroup(), GreatWksSSParser::sendSpreadsheet(), ClarisWksSpreadsheet::sendSpreadsheet(), MsWksTable::sendTable(), MsWrdText::sendTable(), and FullWrtTextInternal::Paragraph::updateToSent().
| bool MWAWColor::operator!= | ( | MWAWColor const & | c | ) | const [inline] |
operator!=
| bool MWAWColor::operator< | ( | MWAWColor const & | c | ) | const [inline] |
operator<
Referenced by operator>=().
| bool MWAWColor::operator<= | ( | MWAWColor const & | c | ) | const [inline] |
operator<=
Referenced by operator>().
| MWAWColor& MWAWColor::operator= | ( | uint32_t | argb | ) | [inline] |
operator=
| bool MWAWColor::operator== | ( | MWAWColor const & | c | ) | const [inline] |
operator==
Referenced by operator!=().
| bool MWAWColor::operator> | ( | MWAWColor const & | c | ) | const [inline] |
operator>
| bool MWAWColor::operator>= | ( | MWAWColor const & | c | ) | const [inline] |
operator>=
| std::string MWAWColor::str | ( | ) | const |
print the color in the form #rrggbb
Referenced by MWAWGraphicStyle::addFrameTo(), MWAWSection::addTo(), MWAWParagraph::addTo(), MWAWGraphicStyle::addTo(), MWAWFont::addTo(), MWAWPageSpan::getPageProperty(), MoreParser::readBackside(), and HanMacWrdKGraph::readTable().
| uint32_t MWAWColor::value | ( | ) | const [inline] |
return the rgba value
Referenced by MWAWPictBitmapInternal::getBMPData(), and MWAWPictBitmapInternal::getPPMData().
| static MWAWColor MWAWColor::white | ( | ) | [inline, static] |
return the white color
Referenced by BeagleWksSSParserInternal::State::getColor(), MacWrtProStructures::getColor(), HanMacWrdKGraphInternal::State::getColor(), HanMacWrdJGraphInternal::State::getColor(), BeagleWksTextInternal::Font::getFont(), ClarisDrawStyleManagerInternal::Gradient::Gradient(), ClarisWksStyleManagerInternal::Gradient::Gradient(), RagTime5StructManager::GraphicStyle::GraphicStyle(), MacDrawProStyleManagerInternal::State::initBWPatterns(), ClarisDrawStyleManagerInternal::State::initBWPatterns(), MacDrawProStyleManagerInternal::State::initColors(), MacDrawParserInternal::State::initPatterns(), MacDraftParserInternal::State::initPatterns(), MWAWGraphicStyle::MWAWGraphicStyle(), ClarisWksStyleManagerInternal::Pattern::Pattern(), RagTimeParserInternal::Pattern::Pattern(), MarinerWrtGraphInternal::Pattern::Pattern(), MWAWGraphicStyle::Pattern::Pattern(), HanMacWrdKGraphInternal::Pattern::Pattern(), HanMacWrdJGraphInternal::Pattern::Pattern(), RagTime5StructManager::GraphicStyle::read(), MacPaintParser::readBitmap(), SuperPaintParser::readBitmap(), BeagleWksBMParser::readBitmap(), MacWrtProStructures::readBlock(), MacDrawProStyleManager::readBWPatterns(), libmwaw_applepict1::OpCode::readColor(), MacDrawProStyleManager::readColorPatterns(), RagTime5Graph::readColorPatternZone(), RagTimeParser::readColorTable(), RagTimeParser::readDataZoneHeader(), LightWayTxtText::readFont2(), MacDrawProStyleManager::readFontStyles(), HanMacWrdJGraph::readFrames(), MacDraftParser::readLabel(), MacDrawProParser::readObject(), MacDraftParser::readPattern(), ClarisDrawStyleManager::readPatternList(), MacDrawProStyleManager::readPatternMap(), BeagleWksDRParser::readStyle(), GreatWksGraph::readStyle(), HanMacWrdKGraph::readTable(), HanMacWrdJGraph::readTableFormatsList(), MarinerWrtTextInternal::Paragraph::BorderFill::resetBackgroundColor(), MWAWFont::resetColor(), MacDrawProParser::send(), BeagleWksDRParser::sendPictures(), MarinerWrtGraph::sendRule(), and ClarisDrawGraph::sendShape().
| std::ostream& operator<< | ( | std::ostream & | o, |
| MWAWColor const & | c | ||
| ) | [friend] |
operator<< in the form #rrggbb
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().