1 #ifndef __color_h
2 #define __color_h
3 
4 // ============================================================================
5 //
6 // Color is the class that allocates the necessary cells on the given port.
7 // At the moment this can only be done on a Display with PseudoColor-visual,
8 // since the puzzle-tile are drawn by using planes for the colors.
9 //
10 // Therefor the Color-class allocates 1 color and 2 planes, so that we have
11 // 4 (private) colors allocated per Color-instance per port. The planes
12 // are used for the 3D effect:
13 //   00 - Top Shadow
14 //   01 - Background
15 //   10 - Foreground
16 //   11 - Bottom Shadow
17 // By the way, this approach only works, as long as XAllocColorCells(...) always
18 // returns the same 2 planes, when asked for 2 plane. (This is not defined, but
19 // I haven't yet heard about problems due to this).
20 //
21 // ============================================================================
22 
23 class Color {
24 	friend class Port;
25 
26 public:
27 
28 	Color( class Port *, int color_id, char *color );
29 	~Color();
30 
31 	GC					gc_n;
32 	unsigned long	pixel;
33 	int				color_id;
34 	class Port		*p;
35 
36 private:
37 	static void brighten( XColor *chg, XColor *org, double percent );
38 	Color				*next;
39 };
40 
41 #endif
42