Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
jop::Color Class Reference

#include <Color.hpp>

Public Member Functions

 Color ()
 Default constructor. More...
 
 Color (const glm::vec3 &rgb, const float32 a=1.f)
 Overloaded constructor. More...
 
 Color (const float32 r, const float32 g, const float32 b, const float32 a=1.f)
 Overloaded constructor. More...
 
 Color (const uint32 colors)
 Overloaded constructor. More...
 
 Color (const std::string &hexString)
 Overloaded constructor. More...
 
glm::vec4 asRGBAVector () const
 Get this color as a RGBA float vector. More...
 
unsigned int asInteger () const
 Get this color as an 32-bit unsigned integer. More...
 
bool operator== (const Color &right) const
 Equality operator. More...
 
bool operator!= (const Color &right) const
 Inequality operator. More...
 
Color operator+ (const Color &right) const
 
Color operator- (const Color &right) const
 
Color operator* (const Color &right) const
 
Color operator* (const float right) const
 
Coloroperator+= (const Color &right)
 
Coloroperator-= (const Color &right)
 
Coloroperator*= (const Color &right)
 
Coloroperator*= (const float right)
 

Public Attributes

glm::vec3 colors
 The RGB color. More...
 
float32 alpha
 Alpha. More...
 

Static Public Attributes

static const Color Black
 Black color. More...
 
static const Color White
 White color. More...
 
static const Color Red
 Red color. More...
 
static const Color Green
 Green color. More...
 
static const Color Blue
 Blue color. More...
 
static const Color Cyan
 Cyan color. More...
 
static const Color Yellow
 Yellow color. More...
 
static const Color Magenta
 Magenta color. More...
 
static const Color Purple
 Purple color. More...
 
static const Color Orange
 Orange color. More...
 
static const Color Gray
 Gray color. More...
 
static const Color Brown
 Brown color. More...
 
static const Color Transparent
 Transparent color. More...
 

Detailed Description

Definition at line 35 of file Color.hpp.

Constructor & Destructor Documentation

jop::Color::Color ( )

Default constructor.

Initializes this color as white.

jop::Color::Color ( const glm::vec3 &  rgb,
const float32  a = 1.f 
)
explicit

Overloaded constructor.

Parameters
rgbThe red, green, blue components
aThe alpha component
jop::Color::Color ( const float32  r,
const float32  g,
const float32  b,
const float32  a = 1.f 
)

Overloaded constructor.

Parameters
rThe red component
gThe green component
bThe blue component
aThe alpha component
jop::Color::Color ( const uint32  colors)
explicit

Overloaded constructor.

Parameters
colorsA 32-bit unsigned integer to represent the colors, as in 0xFFFFFFFF
jop::Color::Color ( const std::string &  hexString)
explicit

Overloaded constructor.

Parameters
hexStringA string in hex form to describe the color, as in "FFFFFFFF"

Member Function Documentation

unsigned int jop::Color::asInteger ( ) const

Get this color as an 32-bit unsigned integer.

Returns
32-bit unsigned integer
glm::vec4 jop::Color::asRGBAVector ( ) const

Get this color as a RGBA float vector.

The precision of the values is 32 bits each.

Returns
Float vector describing the color
bool jop::Color::operator!= ( const Color right) const

Inequality operator.

Color jop::Color::operator* ( const Color right) const
Color jop::Color::operator* ( const float  right) const
Color& jop::Color::operator*= ( const Color right)
Color& jop::Color::operator*= ( const float  right)
Color jop::Color::operator+ ( const Color right) const
Color& jop::Color::operator+= ( const Color right)
Color jop::Color::operator- ( const Color right) const
Color& jop::Color::operator-= ( const Color right)
bool jop::Color::operator== ( const Color right) const

Equality operator.

Member Data Documentation

float32 jop::Color::alpha

Alpha.

Definition at line 93 of file Color.hpp.

const Color jop::Color::Black
static

Black color.

Definition at line 95 of file Color.hpp.

const Color jop::Color::Blue
static

Blue color.

Definition at line 99 of file Color.hpp.

const Color jop::Color::Brown
static

Brown color.

Definition at line 106 of file Color.hpp.

glm::vec3 jop::Color::colors

The RGB color.

Definition at line 92 of file Color.hpp.

const Color jop::Color::Cyan
static

Cyan color.

Definition at line 100 of file Color.hpp.

const Color jop::Color::Gray
static

Gray color.

Definition at line 105 of file Color.hpp.

const Color jop::Color::Green
static

Green color.

Definition at line 98 of file Color.hpp.

const Color jop::Color::Magenta
static

Magenta color.

Definition at line 102 of file Color.hpp.

const Color jop::Color::Orange
static

Orange color.

Definition at line 104 of file Color.hpp.

const Color jop::Color::Purple
static

Purple color.

Definition at line 103 of file Color.hpp.

const Color jop::Color::Red
static

Red color.

Definition at line 97 of file Color.hpp.

const Color jop::Color::Transparent
static

Transparent color.

Definition at line 107 of file Color.hpp.

const Color jop::Color::White
static

White color.

Definition at line 96 of file Color.hpp.

const Color jop::Color::Yellow
static

Yellow color.

Definition at line 101 of file Color.hpp.


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