2011-09-13 15:14:12 +10:00
|
|
|
/*
|
|
|
|
* This file is part of libgim.
|
|
|
|
*
|
|
|
|
* libgim 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.
|
|
|
|
*
|
|
|
|
* libgim is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with libgim. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
2015-01-13 10:50:12 +11:00
|
|
|
* Copyright 2010-2015 Danny Robson <danny@nerdcruft.net>
|
2011-09-13 15:14:12 +10:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UTIL_COLOUR_HPP
|
|
|
|
#define __UTIL_COLOUR_HPP
|
|
|
|
|
2015-01-13 18:33:02 +11:00
|
|
|
#include "detail/coord.hpp"
|
|
|
|
|
2011-10-29 21:17:10 +11:00
|
|
|
#include "json.hpp"
|
2011-09-13 15:14:12 +10:00
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
namespace util {
|
2013-08-05 16:37:11 +10:00
|
|
|
/// An RGBA colour POD type.
|
2015-01-13 18:33:02 +11:00
|
|
|
template <typename T>
|
|
|
|
struct colour : public detail::coord<4, T> {
|
|
|
|
using detail::coord<4,T>::coord;
|
|
|
|
|
2012-06-13 14:41:19 +10:00
|
|
|
static const colour WHITE;
|
|
|
|
static const colour BLACK;
|
2013-07-30 23:50:37 +10:00
|
|
|
static const colour RED;
|
|
|
|
static const colour BLUE;
|
|
|
|
static const colour GREEN;
|
2011-09-13 15:14:12 +10:00
|
|
|
};
|
|
|
|
|
2015-01-13 18:33:02 +11:00
|
|
|
typedef colour<float> colour4f;
|
|
|
|
|
|
|
|
const json::node& operator>> (const json::node&, util::colour4f&);
|
|
|
|
std::ostream& operator<< (std::ostream&, const util::colour4f&);
|
2011-09-13 15:14:12 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|