#include <string>
+
namespace lyx {
void ColorCache::init()
{
for (int col = 0; col <= Color_ignore; ++col)
lcolors_[col] = QColor(lcolor.getX11Name(ColorCode(col)).c_str());
+ initialized_ = true;
+}
+
+
+/// get the given color
+QColor ColorCache::get(ColorCode color) const
+{
+ if (!initialized_)
+ const_cast<ColorCache *>(this)->init();
+ if (color <= Color_ignore)
+ return lcolors_[color];
+ // used by branches
+ return QColor(lcolor.getX11Name(color).c_str());
}