* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Angus Leeming
+ * \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
#include "Color.h"
#include <algorithm> // max
} // 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;