csColor4 Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes
csColor4 Class Reference

A class used to represent a color in RGBA space. More...

`#include <csutil/cscolor.h>`

Inheritance diagram for csColor4:

List of all members.

## Public Member Functions
| csColor4 ()
| Initialize a color object (contents undefined)
| csColor4 (float r, float g, float b, float a=1.0f)
| Initialize a color object with given R,G,B,A components.
bool | operator!= (const csColor4 &c) const
| Compare inequality of two colors.
csColor4 & | operator*= (float f)
| Multiply this color by a scalar value.
csColor4 & | operator+= (const csColor4 &c)
| Add another color to this one.
csColor4 & | operator+= (const csColor &c)
| Add another color to this one.
csColor4 & | operator-= (const csColor4 &c)
| Subtract another color to this one.
csColor & | operator-= (const csColor &c)
| Subtract another color to this one.
csColor4 & | operator= (const csColor4 &c)
| Assign one color object to another.
csColor4 & | operator= (const csColor &c)
| Assign one color object to another/.
bool | operator== (const csColor4 &c) const
| Compare equality of two colors.
float | operator[] (size_t n) const
| Returns n-th component of the color.
float & | operator[] (size_t n)
| Returns n-th component of the color.
void | Set (const csColor &c)
| Set color to given color.
void | Set (float r, float g, float b)
| Set color to given R,G,B components.
## Public Attributes
float | alpha
| Alpha value.

## Detailed Description

A class used to represent a color in RGBA space.

Definition at line 182 of file cscolor.h.

## Constructor & Destructor Documentation

csColor4::csColor4 | ( |  | ) | `[inline]`

Initialize a color object (contents undefined)

Definition at line 189 of file cscolor.h.

csColor4::csColor4 | ( | float | r,
|  | float | g,
|  | float | b,
|  | float | a = `1.0f`
| ) |  | `[inline]`

Initialize a color object with given R,G,B,A components.

Definition at line 191 of file cscolor.h.

## Member Function Documentation

bool csColor4::operator!= | ( | const csColor4 & | c | ) | const`[inline]`

Compare inequality of two colors.

Definition at line 270 of file cscolor.h.

csColor4& csColor4::operator*= | ( | float | f | ) | `[inline]`

Multiply this color by a scalar value.

Reimplemented from csColor.

Definition at line 235 of file cscolor.h.

csColor4& csColor4::operator+= | ( | const csColor4 & | c | ) | `[inline]`

Add another color to this one.

Definition at line 238 of file cscolor.h.

csColor4& csColor4::operator+= | ( | const csColor & | c | ) | `[inline]`

Add another color to this one.

Reimplemented from csColor.

Definition at line 247 of file cscolor.h.

csColor4& csColor4::operator-= | ( | const csColor4 & | c | ) | `[inline]`

Subtract another color to this one.

Definition at line 250 of file cscolor.h.

csColor& csColor4::operator-= | ( | const csColor & | c | ) | `[inline]`

Subtract another color to this one.

Reimplemented from csColor.

Definition at line 259 of file cscolor.h.

csColor4& csColor4::operator= | ( | const csColor4 & | c | ) | `[inline]`

Assign one color object to another.

Definition at line 223 of file cscolor.h.

csColor4& csColor4::operator= | ( | const csColor & | c | ) | `[inline]`

Assign one color object to another/.

Reimplemented from csColor.

Definition at line 232 of file cscolor.h.

bool csColor4::operator== | ( | const csColor4 & | c | ) | const`[inline]`

Compare equality of two colors.

Definition at line 262 of file cscolor.h.

float csColor4::operator[] | ( | size_t | n | ) | const`[inline]`

Returns n-th component of the color.

Reimplemented from csColor.

Definition at line 279 of file cscolor.h.

float& csColor4::operator[] | ( | size_t | n | ) | `[inline]`

Returns n-th component of the color.

Reimplemented from csColor.

Definition at line 283 of file cscolor.h.

void csColor4::Set | ( | const csColor & | c | ) | `[inline]`

Set color to given color.

Reimplemented from csColor.

Definition at line 194 of file cscolor.h.

void csColor4::Set | ( | float | r,
|  | float | g,
|  | float | b
| ) |  | `[inline]`

Set color to given R,G,B components.

Reimplemented from csColor.

Definition at line 208 of file cscolor.h.

## Member Data Documentation

float csColor4::alpha

Alpha value.

Definition at line 186 of file cscolor.h.

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

- csutil/cscolor.h