Color.hh 971 Bytes
/*
 * Color.hh
 *
 *  Created on: 28 oct. 2013
 *      Author: CS
 */

#ifndef COLOR_HH_
#define COLOR_HH_

#include "PlotCommon.hh"

#include <ostream>
#include <vector>

namespace plot {

class Color {
public:

	Color();

	Color(int red, int green, int blue);

	Color(int colorMapIndex, int colorIndex);

	Color(const Color& color);

	virtual ~Color() {};

	bool isSet(){
		return _red != -1 || _colorIndex != -1;
	}

	int _red;
	int _green;
	int _blue;

	int _colorMapIndex;
	int _colorIndex;

	void dump(std::ostream& out, std::string& prefix) {
		out << prefix << "color.red=" << _red << std::endl;
		out << prefix << "color.green=" << _green << std::endl;
		out << prefix << "color.blue=" << _blue << std::endl;
		out << prefix << "color.mapindex=" << _colorMapIndex << std::endl;
		out << prefix << "color.index=" << _colorIndex << std::endl;
	}
};

std::ostream& operator << (std::ostream& out, const Color& color);

} /* namespace plot */
#endif /* COLOR_HH_ */