Ipelib: ipe::Color Class Reference

Ipelib

Public Member Functions | Public Attributes | Related Functions | List of all members
ipe::Color Class Reference
Ipe Attributes

`#include <ipeattributes.h>`

## Public Member Functions
| Color ()
| Color (String str)
| Color (int r, int g, int b)
void | save (Stream &stream) const
void | saveRGB (Stream &stream) const
bool | isGray () const
bool | operator== (const Color &rhs) const
bool | operator!= (const Color &rhs) const

## Public Attributes
Fixed | iRed
Fixed | iGreen
Fixed | iBlue

## Related Functions
(Note that these are not member functions.)
Stream & | operator<< (Stream &stream, const Color &attr)

## Detailed Description

An absolute RGB color.

## Constructor & Destructor Documentation

## ◆ Color() [1/3]

ipe::Color::Color | ( |  | ) |
| inline

Default constructor.

References isGray(), operator==(), save(), and saveRGB().

Referenced by ipe::Attribute::makeColor().

## ◆ Color() [2/3]

Color::Color | ( | String | str | ) |
| explicit

Construct a color from a string.

If only a single number is given, this is a gray value, otherwise red, green, and blue components must be given.

References ipe::Lex::eos(), iBlue, iGreen, and iRed.

## ◆ Color() [3/3]

Color::Color | ( | int | red,
|  | int | green,
|  | int | blue
| ) |  |
| explicit

Construct a color.

Arguments red, green, blue range from 0 to 1000.

References ipe::Fixed::fromInternal(), iBlue, iGreen, and iRed.

## Member Function Documentation

## ◆ save()

void Color::save | ( | Stream & | stream | ) | const

Save to stream.

References iBlue, iGreen, iRed, and isGray().

Referenced by Color(), and operator<<().

## ◆ saveRGB()

void Color::saveRGB | ( | Stream & | stream | ) | const

Save to stream in long format.

The RGB components are saved separately even for gray colors.

References iBlue, iGreen, and iRed.

Referenced by Color(), and ipe::PdfPainter::drawAttributes().

## ◆ isGray()

bool Color::isGray | ( |  | ) | const

is it an absolute gray value?

References iBlue, iGreen, and iRed.

Referenced by Color(), ipe::Latex::createLatexSource(), ipe::PdfPainter::drawColor(), and save().

## ◆ operator==()

bool Color::operator== | ( | const Color & | rhs | ) | const

References ipe::Effect::Effect(), iBlue, iGreen, and iRed.

Referenced by Color().

## ◆ operator!=()

bool ipe::Color::operator!= | ( | const Color & | rhs | ) | const
| inline

## Friends And Related Function Documentation

## ◆ operator<<()

Stream & operator<< | ( | Stream & | stream,
|  | const Color & | attr
| ) |  |
| related

References save().

## Member Data Documentation

## ◆ iRed

Fixed ipe::Color::iRed

Referenced by ipe::Attribute::Attribute(), Color(), ipe::Attribute::color(), ipe::Latex::createLatexSource(), ipe::CairoPainter::doDrawPath(), ipe::CairoPainter::doDrawText(), ipe::PdfPainter::drawColor(), isGray(), operator==(), ipe::QIpe(), ipe::PdfViewBase::refreshSurface(), save(), saveRGB(), and ipe::Canvas::sizeHint().

## ◆ iGreen

Fixed ipe::Color::iGreen

Referenced by ipe::Attribute::Attribute(), Color(), ipe::Attribute::color(), ipe::Latex::createLatexSource(), ipe::CairoPainter::doDrawPath(), ipe::CairoPainter::doDrawText(), isGray(), operator==(), ipe::QIpe(), ipe::PdfViewBase::refreshSurface(), save(), saveRGB(), and ipe::Canvas::sizeHint().

## ◆ iBlue

Fixed ipe::Color::iBlue

Referenced by ipe::Attribute::Attribute(), Color(), ipe::Attribute::color(), ipe::Latex::createLatexSource(), ipe::CairoPainter::doDrawPath(), ipe::CairoPainter::doDrawText(), isGray(), operator==(), ipe::QIpe(), ipe::PdfViewBase::refreshSurface(), save(), saveRGB(), and ipe::Canvas::sizeHint().

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

- ipeattributes.h
- ipeattributes.cpp