Carna  Version 3.0.1
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.


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