#include <color.hpp>
Public Member Functions | |
Color () | |
Color (float red_, float green_, float blue_, float alpha_=1.0) | |
Color (const std::vector< float > &vals) | |
bool | operator== (const Color &other) const |
float | greyscale () const |
bool | operator< (const Color &other) const |
Public Attributes | |
float | red |
float | green |
float | blue |
float | alpha |
Static Public Attributes | |
static const Color | BLACK |
static const Color | RED |
static const Color | GREEN |
static const Color | BLUE |
static const Color | CYAN |
static const Color | MAGENTA |
static const Color | YELLOW |
static const Color | WHITE |
Definition at line 25 of file color.hpp.
Color::Color | ( | ) | [inline] |
Color::Color | ( | float | red_, | |
float | green_, | |||
float | blue_, | |||
float | alpha_ = 1.0 | |||
) | [inline] |
Color::Color | ( | const std::vector< float > & | vals | ) | [inline] |
Definition at line 46 of file color.hpp.
References alpha, blue, green, and red.
00046 : 00047 red(), 00048 green(), 00049 blue(), 00050 alpha() 00051 { 00052 assert(vals.size() >= 3); 00053 red = vals[0]; 00054 green = vals[1]; 00055 blue = vals[2]; 00056 if(vals.size() > 3) 00057 alpha = vals[3]; 00058 else 00059 alpha = 1.0; 00060 assert(0 <= red && red <= 1.0); 00061 assert(0 <= green && green <= 1.0); 00062 assert(0 <= blue && blue <= 1.0); 00063 }
bool Color::operator== | ( | const Color & | other | ) | const [inline] |
float Color::greyscale | ( | ) | const [inline] |
bool Color::operator< | ( | const Color & | other | ) | const [inline] |
float Color::red |
Definition at line 81 of file color.hpp.
Referenced by Color(), colorize(), DrawingContext::do_drawing(), SDLRenderer::draw_filled_rect(), SDLLightmap::draw_filled_rect(), GLRenderer::draw_filled_rect(), GLLightmap::draw_filled_rect(), GLRenderer::draw_inverse_ellipse(), SDLLightmap::draw_surface(), Sector::get_ambient_red(), DrawingContext::get_light(), greyscale(), SDLTexture::ColorCache::hash(), intern_draw(), GhostTree::is_color_deadly(), Lantern::is_open(), MagicBlock::MagicBlock(), operator==(), Sector::parse_old_format(), Sector::set_ambient_light(), Gradient::set_gradient(), SDLLightmap::start_draw(), GLLightmap::start_draw(), MagicBlock::update(), and Lantern::updateColor().
float Color::green |
Definition at line 81 of file color.hpp.
Referenced by Color(), colorize(), DrawingContext::do_drawing(), SDLRenderer::draw_filled_rect(), SDLLightmap::draw_filled_rect(), GLRenderer::draw_filled_rect(), GLLightmap::draw_filled_rect(), GLRenderer::draw_inverse_ellipse(), SDLLightmap::draw_surface(), Sector::get_ambient_green(), DrawingContext::get_light(), greyscale(), SDLTexture::ColorCache::hash(), intern_draw(), GhostTree::is_color_deadly(), Lantern::is_open(), MagicBlock::MagicBlock(), operator==(), Sector::parse_old_format(), Sector::set_ambient_light(), Gradient::set_gradient(), SDLLightmap::start_draw(), GLLightmap::start_draw(), MagicBlock::update(), and Lantern::updateColor().
float Color::blue |
Definition at line 81 of file color.hpp.
Referenced by Color(), colorize(), DrawingContext::do_drawing(), SDLRenderer::draw_filled_rect(), SDLLightmap::draw_filled_rect(), GLRenderer::draw_filled_rect(), GLLightmap::draw_filled_rect(), GLRenderer::draw_inverse_ellipse(), SDLLightmap::draw_surface(), Sector::get_ambient_blue(), DrawingContext::get_light(), greyscale(), SDLTexture::ColorCache::hash(), intern_draw(), GhostTree::is_color_deadly(), Lantern::is_open(), MagicBlock::MagicBlock(), operator==(), Sector::parse_old_format(), Sector::set_ambient_light(), Gradient::set_gradient(), SDLLightmap::start_draw(), GLLightmap::start_draw(), MagicBlock::update(), and Lantern::updateColor().
float Color::alpha |
Definition at line 81 of file color.hpp.
Referenced by Color(), FadeOut::draw(), PulsingLight::draw(), SDLRenderer::draw_filled_rect(), SDLLightmap::draw_filled_rect(), GLRenderer::draw_filled_rect(), GLLightmap::draw_filled_rect(), DrawingContext::draw_filled_rect(), GLRenderer::draw_inverse_ellipse(), DrawingContext::draw_inverse_ellipse(), SDLLightmap::draw_surface(), intern_draw(), MagicBlock::MagicBlock(), operator==(), Gradient::set_gradient(), and MagicBlock::update().
const Color Color::BLACK [static] |
const Color Color::RED [static] |
const Color Color::GREEN [static] |
const Color Color::BLUE [static] |
const Color Color::CYAN [static] |
const Color Color::MAGENTA [static] |
const Color Color::YELLOW [static] |
const Color Color::WHITE [static] |
Definition at line 90 of file color.hpp.
Referenced by SDLTexture::get_transform(), and SDLTexture::SDLTexture().