]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Color.h
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / Color.h
index 95186eabe73ee11c9c73d65b3bec424f6d11d68d..a297ae0765c3cf97f640ec7df7182e9cbc561701 100644 (file)
@@ -6,7 +6,7 @@
  *
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 /* structs RGBColor and HSVColor to enable simple conversion between
 #ifndef COLOR_H
 #define COLOR_H
 
+#include <string>
+
+
+class LColor_color;
 
-#include "LString.h"
-#include "LColor.h"
 
 /** Given col, fills r, g, b in the range 0-255.
     The function returns true if successful.
     It returns false on failure and sets r, g, b to 0. */
-bool getRGBColor(LColor::color col,
+bool getRGBColor(LColor_color col,
                 unsigned int & r, unsigned int & g, unsigned int & b);
 
 struct RGBColor;
+/// returns a string of form #rrggbb, given an RGBColor struct
+std::string const X11hexname(RGBColor const & col);
 
 struct HSVColor {
        double h;
@@ -46,15 +50,18 @@ struct RGBColor {
        RGBColor(unsigned int red, unsigned int green, unsigned int blue)
                : r(red), g(green), b(blue) {}
        RGBColor(HSVColor const &);
+       /// \param x11hexname is of the form "#ffa071"
+       RGBColor(std::string const & x11hexname);
 };
 
 struct NamedColor : public RGBColor {
-       string name;
+       std::string lyxname;
+       std::string guiname;
        NamedColor() : RGBColor() {}
-       NamedColor(string const & n, RGBColor const & c)
-               : RGBColor(c), name(n) {}
+       NamedColor(std::string const & lyx, std::string const & gui,
+                  RGBColor const & c)
+               : RGBColor(c), lyxname(lyx), guiname(gui) {}
        RGBColor const & color() const { return *this; }
-       string const & getname() const { return name; }
 };
 
 inline