MWAWColor Struct Reference

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
MWAWColoroperator= (MWAWColor const &)=default
 operator=
MWAWColoroperator= (MWAWColor &&)=default
 move operator=
MWAWColoroperator= (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

Detailed Description

the class to store a color

Constructor & Destructor Documentation

◆ MWAWColor() [1/4]

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

◆ black()

MWAWColor MWAWColor::black ( )
inlinestatic

return the back color

Referenced by RagTimeParser::createZones(), FullWrtText::FullWrtParser, MacDraft5StyleManagerInternal::Pixmap::get(), MWAWPictBitmapBW::getAverageColor(), MWAWPictBitmapColor::getAverageColor(), MWAWPictBitmapIndexed::getAverageColor(), DrawTableParser::getBitmap(), BeagleWksSSParserInternal::State::getColor(), CricketDrawParserInternal::State::getColor(), DrawTableParserInternal::State::getColor(), ClarisDrawStyleManagerInternal::Gradient::Gradient(), ClarisWksStyleManagerInternal::Gradient::Gradient(), MWAWGraphicStyle::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(), CanvasGraphInternal::Shape::operator<<, ClarisWksStyleManagerInternal::Pattern::Pattern(), HanMacWrdJGraphInternal::Pattern::Pattern(), HanMacWrdKGraphInternal::Pattern::Pattern(), MarinerWrtGraphInternal::Pattern::Pattern(), MWAWGraphicStyle::Pattern::Pattern(), MWAWGraphicStyle::Pattern::Pattern(), RagTimeParserInternal::Pattern::Pattern(), Canvas5StyleManagerInternal::PenStyle::PenStyle(), RagTimeText::RagTimeParser, RagTime5StyleManager::GraphicStyle::read(), BeagleWksBMParser::readBitmap(), Canvas5Structure::readBitmap(), MacPaintParser::readBitmap(), ScoopParser::readBitmap(), SuperPaintParser::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(), PowerPoint1Parser::readFramesList(), PowerPoint3Parser::readFramesList(), FreeHandParser::readLineStyle(), MacDrawProParser::readObject(), MacDraftParser::readPattern(), ClarisDrawStyleManager::readPatternList(), MacDrawProStyleManager::readPatternMap(), MacDraft5StyleManager::readPatterns(), SuperPaintParser::readShape(), ReadySetGoGraph::readShapeDSV2(), ReadySetGoGraph::readShapeV3(), ReadySetGoGraph::readShapeV6(), GreatWksGraph::readStyle(), PowerPoint7Graph::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(), StudentWritingCParser::sendText(), and MWAWGraphicStyle::Gradient::Stop::Stop().

◆ colorFromCMYK()

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

◆ colorFromHSL()

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

◆ getBlue()

◆ getGreen()

◆ getRed()

◆ isBlack()

◆ isWhite()

◆ 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 && )
default

move operator=

◆ operator=() [2/3]

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

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

◆ value()

uint32_t MWAWColor::value ( ) const
inline

◆ white()

MWAWColor MWAWColor::white ( )
inlinestatic

return the white color

Referenced by DrawTableParser::getBitmap(), CanvasGraph::getBitmapBW(), BeagleWksSSParserInternal::State::getColor(), CricketDrawParserInternal::State::getColor(), DrawTableParserInternal::State::getColor(), HanMacWrdJGraphInternal::State::getColor(), HanMacWrdKGraphInternal::State::getColor(), MacWrtProStructures::getColor(), BeagleWksTextInternal::Font::getFont(), RagTime5StyleManager::getLineColor(), ClarisDrawStyleManagerInternal::Gradient::Gradient(), ClarisWksStyleManagerInternal::Gradient::Gradient(), MWAWGraphicStyle::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(), CanvasGraphInternal::Shape::operator<<, ClarisWksStyleManagerInternal::Pattern::Pattern(), HanMacWrdJGraphInternal::Pattern::Pattern(), HanMacWrdKGraphInternal::Pattern::Pattern(), MarinerWrtGraphInternal::Pattern::Pattern(), MWAWGraphicStyle::Pattern::Pattern(), MWAWGraphicStyle::Pattern::Pattern(), RagTimeParserInternal::Pattern::Pattern(), RagTime5StyleManager::GraphicStyle::read(), BeagleWksBMParser::readBitmap(), Canvas5Structure::readBitmap(), MacPaintParser::readBitmap(), ScoopParser::readBitmap(), SuperPaintParser::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(), PowerPoint1Parser::readFramesList(), PowerPoint3Parser::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(), GreatWksGraph::readStyle(), PowerPoint7Graph::readStyle(), ReadySetGoStyleManager::readStyle(), HanMacWrdKGraph::readTable(), HanMacWrdJGraph::readTableFormatsList(), ApplePictParser::readZone(), MarinerWrtTextInternal::Paragraph::BorderFill::resetBackgroundColor(), MWAWFont::resetColor(), Canvas5Graph::send(), CanvasGraph::send(), MacDrawProParser::send(), CricketDrawParser::sendBitmap(), Canvas5Graph::sendDimension(), CanvasGraph::sendDimension(), CanvasGraph::sendMultiLines(), BeagleWksDRParser::sendPictures(), MarinerWrtGraph::sendRule(), ClarisDrawGraph::sendShape(), MWAWPageSpan::setBackgroundColor(), FreeHandParserInternal::State::updateFillStyle(), FreeHandParserInternal::State::updateLineStyle(), and RagTime5StyleManager::updateSurfaceStyle().

◆ 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 documentation for this struct was generated from the following files:

Generated on Sun Jun 29 2025 04:36:27 for libmwaw by doxygen 1.14.0