2021-12-26 21:19:38 +01:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2008-06-13 14:57:47 +00:00
|
|
|
*
|
2021-12-26 21:19:38 +01:00
|
|
|
* ScummVM is the legal property of its developers, whose names
|
2011-04-16 14:12:44 +02:00
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
2008-06-13 14:57:47 +00:00
|
|
|
* file distributed with this source distribution.
|
2006-04-02 14:20:45 +00:00
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2014-04-05 18:18:42 +02:00
|
|
|
*
|
2012-12-19 23:15:43 +01:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2006-04-02 14:20:45 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-12-19 23:15:43 +01:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-04-05 18:18:42 +02:00
|
|
|
*
|
2012-12-19 23:15:43 +01:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2006-04-02 14:20:45 +00:00
|
|
|
*
|
|
|
|
*/
|
2003-08-15 18:00:22 +00:00
|
|
|
|
2009-05-26 09:39:42 +00:00
|
|
|
#ifndef GRIM_COLOR_H
|
|
|
|
#define GRIM_COLOR_H
|
2003-08-15 18:00:22 +00:00
|
|
|
|
2012-03-26 20:12:00 -07:00
|
|
|
#include "common/endian.h"
|
2004-02-24 21:09:53 +00:00
|
|
|
|
2009-05-25 06:49:57 +00:00
|
|
|
namespace Grim {
|
|
|
|
|
2011-09-07 23:08:59 +02:00
|
|
|
class Color {
|
2003-08-15 18:00:22 +00:00
|
|
|
public:
|
2004-12-09 23:55:43 +00:00
|
|
|
byte _vals[3];
|
2003-08-15 18:00:22 +00:00
|
|
|
|
2011-09-18 17:10:12 +02:00
|
|
|
Color();
|
2011-05-24 22:18:01 -07:00
|
|
|
Color(byte r, byte g, byte b);
|
2013-07-09 21:12:55 +02:00
|
|
|
Color(const Color &c);
|
2012-01-27 11:47:28 -08:00
|
|
|
Color(uint32 c);
|
2011-05-24 22:18:01 -07:00
|
|
|
|
2011-05-05 10:58:29 +02:00
|
|
|
byte &getRed() { return _vals[0]; }
|
|
|
|
byte getRed() const { return _vals[0]; }
|
|
|
|
byte &getGreen() { return _vals[1]; }
|
|
|
|
byte getGreen() const { return _vals[1]; }
|
|
|
|
byte &getBlue() { return _vals[2]; }
|
|
|
|
byte getBlue() const { return _vals[2]; }
|
2003-08-15 18:00:22 +00:00
|
|
|
|
2012-01-27 11:47:28 -08:00
|
|
|
uint32 toEncodedValue();
|
|
|
|
|
2013-07-09 21:12:55 +02:00
|
|
|
Color &operator =(const Color &c);
|
2013-10-25 07:40:30 -07:00
|
|
|
Color &operator =(const Color *c);
|
2011-09-07 23:08:59 +02:00
|
|
|
};
|
2011-05-24 22:18:01 -07:00
|
|
|
|
2003-08-15 18:00:22 +00:00
|
|
|
|
2009-05-25 06:49:57 +00:00
|
|
|
} // end of namespace Grim
|
|
|
|
|
2003-08-15 18:00:22 +00:00
|
|
|
#endif
|