4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
12 /* structs RGBColor and HSVColor to enable simple conversion between
24 /// returns a string of form #rrggbb, given an RGBColor struct
25 std::string const X11hexname(RGBColor const & col);
31 HSVColor() : h(0.0), s(0.0), v(0.0) {}
32 HSVColor(double hue, double sat, double val)
33 : h(hue), s(sat), v(val) {}
34 HSVColor(RGBColor const &);
41 RGBColor() : r(0), g(0), b(0) {}
42 RGBColor(unsigned int red, unsigned int green, unsigned int blue)
43 : r(red), g(green), b(blue) {}
44 RGBColor(HSVColor const &);
45 /// \param x11hexname is of the form "#ffa071"
46 RGBColor(std::string const & x11hexname);
49 struct NamedColor : public RGBColor {
52 NamedColor() : RGBColor() {}
53 NamedColor(std::string const & lyx, std::string const & gui,
55 : RGBColor(c), lyxname(lyx), guiname(gui) {}
56 RGBColor const & color() const { return *this; }
60 bool operator==(RGBColor const & c1, RGBColor const & c2)
62 return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
67 bool operator!=(RGBColor const & c1, RGBColor const & c2)