Ipelib: ipe::Color Class Reference

Ipelib

- Main Page
- Modules
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Related Functions

# ipe::Color Class Reference
Ipe Attributes

An absolute RGB color. More...

`#include <ipeattributes.h>`

List of all members.

## 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

ipe::Color::Color | ( |  | ) | `[inline]`

Default constructor.

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.

Color::Color | ( | int | red,
|  | int | green,
|  | int | blue
| ) |  | `[explicit]`

Construct a color.

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

## Member Function Documentation

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

Save to stream.

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

Save to stream in long format.

The RGB components are saved separately even for gray colors.

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

is it an absolute gray value?

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

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

## Friends And Related Function Documentation

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

## Member Data Documentation

Fixed ipe::Color::iRed

Fixed ipe::Color::iGreen

Fixed ipe::Color::iBlue

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

- ipeattributes.h
- ipeattributes.cpp