#ifndef COLOR_H
#define COLOR_H
-#include<utility> // for pair
+#include <utility> // for pair
#ifdef __GNUG_
#pragma interface
#include "LString.h"
-class HSV;
-class RGB;
+class HSVColor;
+class RGBColor;
-struct HSV {
+struct HSVColor {
double h;
double s;
double v;
- HSV() : h(0.0), s(0.0), v(0.0) {}
- HSV(double hue, double sat, double val) : h(hue), s(sat), v(val) {}
- HSV( RGB const & );
+ HSVColor() : h(0.0), s(0.0), v(0.0) {}
+ HSVColor(double hue, double sat, double val) : h(hue), s(sat), v(val) {}
+ HSVColor( RGBColor const & );
};
-struct RGB {
+struct RGBColor {
int r;
int g;
int b;
- RGB() : r(0), g(0), b(0) {}
- RGB(int red, int green, int blue) : r(red), g(green), b(blue) {}
- RGB( HSV const & );
+ RGBColor() : r(0), g(0), b(0) {}
+ RGBColor(int red, int green, int blue) : r(red), g(green), b(blue) {}
+ RGBColor( HSVColor const & );
};
-typedef std::pair<string, RGB> X11Color;
+typedef std::pair<string, RGBColor> X11Color;
/// struct holding xform-specific colors
-struct XFormColor {
+struct XformColor {
string name;
int colorID;
- RGB col;
- XFormColor() : colorID(0) {}
+ RGBColor col;
+ XformColor() : colorID(0) {}
string const getname() { return name; }
+ static bool read( string const & );
+ static bool write( string const & );
};
inline
-bool operator==(RGB const & c1, RGB const & c2)
+bool operator==(RGBColor const & c1, RGBColor const & c2)
{
return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
}
inline
-bool operator!=(RGB const & c1, RGB const & c2)
+bool operator!=(RGBColor const & c1, RGBColor const & c2)
{
return !(c1 == c2);
}