Carna Version 3.3.3
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Carna::base::Color Class Reference

Represents a color. Objects from this class are copyable and assignable. More...

#include <Color.h>

+ Collaboration diagram for Carna::base::Color:

Public Member Functions

 Color (const math::Vector4f &)
 Instantiates from floating point values, clamped to interval \(\left[0, 1\right]\).
 
 Color (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 Instantiates.
 
 Color ()
 Instantiates with BLACK_NO_ALPHA.
 
 operator math::Vector4f () const
 Converts to floating point representation with values in interval \(\left[0, 1\right]\).
 
bool operator== (const Color &other) const
 Compares to other.
 
bool operator< (const Color &other) const
 Compares to other.
 
Coloroperator= (const Color &other)
 Assigns values from other.
 

Public Attributes

unsigned char r
 Holds the red component.
 
unsigned char g
 Holds the green component.
 
unsigned char b
 Holds the blue component.
 
unsigned char a
 Holds the alpha component.
 

Static Public Attributes

static const Color WHITE
 Holds Color(255, 255, 255, 255).
 
static const Color WHITE_NO_ALPHA
 Holds Color(255, 255, 255, 0).
 
static const Color BLACK
 Holds Color(0, 0, 0, 255).
 
static const Color BLACK_NO_ALPHA
 Holds Color(0, 0, 0, 0).
 
static const Color RED
 Holds Color(255, 0, 0, 255).
 
static const Color RED_NO_ALPHA
 Holds Color(255, 0, 0, 0).
 
static const Color GREEN
 Holds Color(0, 255, 0, 255).
 
static const Color GREEN_NO_ALPHA
 Holds Color(0, 255, 0, 0).
 
static const Color BLUE
 Holds Color(0, 0, 255, 255).
 
static const Color BLUE_NO_ALPHA
 Holds Color(0, 0, 255, 0).
 

Detailed Description

Represents a color. Objects from this class are copyable and assignable.

Author
Leonid Kostrykin
Date
22.2.15 - 17.3.15

Definition at line 41 of file Color.h.

Member Data Documentation

◆ a

unsigned char Carna::base::Color::a

Holds the alpha component.

Definition at line 76 of file Color.h.

◆ b

unsigned char Carna::base::Color::b

Holds the blue component.

Definition at line 75 of file Color.h.

◆ BLACK

const Color Carna::base::Color::BLACK
static

Holds Color(0, 0, 0, 255).

Definition at line 48 of file Color.h.

◆ BLACK_NO_ALPHA

const Color Carna::base::Color::BLACK_NO_ALPHA
static

Holds Color(0, 0, 0, 0).

Definition at line 49 of file Color.h.

◆ BLUE

const Color Carna::base::Color::BLUE
static

Holds Color(0, 0, 255, 255).

Definition at line 54 of file Color.h.

◆ BLUE_NO_ALPHA

const Color Carna::base::Color::BLUE_NO_ALPHA
static

Holds Color(0, 0, 255, 0).

Definition at line 55 of file Color.h.

◆ g

unsigned char Carna::base::Color::g

Holds the green component.

Definition at line 74 of file Color.h.

◆ GREEN

const Color Carna::base::Color::GREEN
static

Holds Color(0, 255, 0, 255).

Definition at line 52 of file Color.h.

◆ GREEN_NO_ALPHA

const Color Carna::base::Color::GREEN_NO_ALPHA
static

Holds Color(0, 255, 0, 0).

Definition at line 53 of file Color.h.

◆ r

unsigned char Carna::base::Color::r

Holds the red component.

Definition at line 73 of file Color.h.

◆ RED

const Color Carna::base::Color::RED
static

Holds Color(255, 0, 0, 255).

Definition at line 50 of file Color.h.

◆ RED_NO_ALPHA

const Color Carna::base::Color::RED_NO_ALPHA
static

Holds Color(255, 0, 0, 0).

Definition at line 51 of file Color.h.

◆ WHITE

const Color Carna::base::Color::WHITE
static

Holds Color(255, 255, 255, 255).

Definition at line 46 of file Color.h.

◆ WHITE_NO_ALPHA

const Color Carna::base::Color::WHITE_NO_ALPHA
static

Holds Color(255, 255, 255, 0).

Definition at line 47 of file Color.h.


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