Backspace sends DEL instead of ^H.
[spft.git] / Colors.h
blob5d54e8d39bb3687eb4ae3e214bf42e459bb4a406
1 #ifndef Colors_h
2 #define Colors_h
4 #include <stdint.h>
5 #include <X11/Xft/Xft.h>
6 #include <map>
8 // Colors are represented as uint32_t's. If the high bit is set, it's a "true
9 // color" represented as 0x80rrggbb. Otherwise, it's an ANSI color index.
12 class Colors {
13 public:
14 enum {
15 true_color_bit = 0x80000000,
18 Colors() : initialized(false) {}
19 ~Colors();
21 void init(Display* display);
22 const XftColor* xft_color(uint32_t color);
24 protected:
25 bool initialized;
26 XftColor indexed_colors[256];
27 std::map<uint32_t, XftColor> true_colors;
29 Display* display;
32 extern Colors colors;
35 #endif // !Colors_h