1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __rendercolor_hh
3 #define __rendercolor_hh
19 RGB(int red, int green, int blue) : r(red), g(green), b(blue) {}
20 // color is in ARGB format
21 RGB(unsigned long color)
22 : r((color >> 16) & 0xff),
23 g((color >> 8) & 0xff),
31 CacheItem(GC g) : gc(g), count(0) {}
33 static std::map<unsigned long, CacheItem*> *_cache;
45 static void initialize();
46 static void destroy();
48 RenderColor(int screen, unsigned char red,
49 unsigned char green, unsigned char blue);
50 RenderColor(int screen, RGB rgb);
51 virtual ~RenderColor();
53 inline int screen() const { return _screen; }
54 inline unsigned char red() const { return _red; }
55 inline unsigned char green() const { return _green; }
56 inline unsigned char blue() const { return _blue; }
57 inline GC gc() const { return _gc; }
62 #endif // __rendercolor_hh