1 // $Id: main.cpp 3314 2006-04-12 12:36:29Z matzebraun $
4 // Copyright (C) 2005 Matthias Braun <matze@braunis.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
30 : red(0), green(0), blue(0), alpha(1.0)
32 Color(float red, float green, float blue, float alpha = 1.0)
33 : red(red), green(green), blue(blue), alpha(alpha)
39 Color(const std::vector<float>& vals)
53 void check_color_ranges()
55 if(red < 0 || red > 1.0 || green < 0 || green > 1.0
56 || blue < 0 || blue > 1.0
57 || alpha < 0 || alpha > 1.0)
58 log_warning << "color value out of range: " << red << ", " << green << ", " << blue << ", " << alpha << std::endl;
61 float red, green, blue, alpha;