3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
14 #include "lcolorcache.h"
18 LColorCache lcolorcache;
20 const QColor grey40(0x66, 0x66, 0x66);
21 const QColor grey60(0x99, 0x99, 0x99);
22 const QColor grey80(0xcc, 0xcc, 0xcc);
23 const QColor grey90(0xe5, 0xe5, 0xe5);
26 LColorCache::LColorCache()
30 QColor const & LColorCache::get(LColor_color col) const
32 lcolor_map::const_iterator cit = colormap.find(col);
33 if (cit != colormap.end())
36 if (lcolor.getX11Name(col) == "grey40")
37 colormap[col] = grey40;
38 else if (lcolor.getX11Name(col) == "grey60")
39 colormap[col] = grey60;
40 else if (lcolor.getX11Name(col) == "grey80")
41 colormap[col] = grey80;
42 else if (lcolor.getX11Name(col) == "grey90")
43 colormap[col] = grey90;
45 colormap[col] = QColor(lcolor.getX11Name(col).c_str());
51 void LColorCache::clear()
57 QColor const rgb2qcolor(lyx::RGBColor const & rgb)
59 return QColor(rgb.r, rgb.g, rgb.b);