]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Color.C
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / Color.C
index 57a210ba709ec97a216d53214387221815abf6f4..25c9d3dcd84cca7425100aa9de13fdc2c3722879 100644 (file)
@@ -10,9 +10,6 @@
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "Color.h"
 #include <algorithm> // max
@@ -32,6 +29,29 @@ int const nohue = -1;
 
 } // namespace anon
 
+
+bool getRGBColor(LColor::color col,
+                unsigned int & r, unsigned int & g, unsigned int & b)
+{
+       string const name = lcolor.getX11Name(col);
+       Display * const display = fl_get_display();
+       Colormap const cmap = fl_state[fl_get_vclass()].colormap;
+       XColor xcol, ccol;
+
+       if (XLookupColor(display, cmap, name.c_str(), &xcol, &ccol) == 0) {
+               r = 0;
+               g = 0;
+               b = 0;
+               return false;
+       }
+
+       r = xcol.red   / 256;
+       g = xcol.green / 256;
+       b = xcol.blue  / 256;
+       return true;
+}
+
+
 RGBColor::RGBColor(HSVColor const & hsv)
 {
        double h = hsv.h;