xref: /haiku/docs/develop/servers/app_server/SystemPalette.rst (revision c237c4ce593ee823d9867fd997e51e4c447f5623)
1SystemPalette class
2###################
3
4This object does all the handling for system attribute colors and system
5palette management.
6
7Member Functions
8================
9
10_ Denotes a protected function
11
12SystemPalette(void)
13-------------------
14
151. Allocate the rgb_color[256] palette on the heap and call _GenerateSystemPalette()
162. Initialize attribute variables to the defaults
17
18~SystemPalette(void)
19--------------------
20
211) Free the palette array
22
23void SetPalette(uint8 index, RGBColor col), void SetPalette(uint8 index, rgb_color col)
24---------------------------------------------------------------------------------------
25
26Sets the said index to the passed color value.
27
28RGBColor GetPalette(uint8 index)
29--------------------------------
30
31Returns the color at said index in the palette.
32
33void SetGUIColor(color_which which, RGBColor col)
34-------------------------------------------------
35
36RGBColor GetGUIColor(color_which which)
37---------------------------------------
38
39color_set GetGUIColors(void)
40----------------------------
41
42void SetGUIColors(color_set cset)
43---------------------------------
44
45These tweak or return the system attribute colors, one at a time or all at once.
46
47protected: void \_GenerateSystemPalette(rgb_color \*palette)
48------------------------------------------------------------
49
50Sets the passed palette to the BeOS R5 system colors, which follows.
51
52Grays:
53......
54
550,0,0 -> 248,248,248 by increments of 8
56
57Blues:
58......
59
600,0,255
61
620,0,229
63
640,0,204
65
660,0,179
67
680,0,154
69
700,0,129
71
720,0,105
73
740,0,80
75
760,0,55
77
780,0,30
79
80Reds:
81.....
82
83as per blues, but red values are 1 less
84
85Greens:
86.......
87
88as per blues, but green values are 1 less
89
900,152,51
91
92255,255,255
93
94The following sets use [255, 203, 152, 102, 51, 0] for the blue values,
95keeping the other colors the same:
96
97203,255, [value]
98
99152,255, [value]
100
101102,255, [value]
102
10351,255, [value]
104
105255,152, [value]
106
1070,102,255
108
1090,102,203
110
111203,203, [value]
112
113152,255, [value]
114
115102,255, [value]
116
11751,255, [value]
118
119255,102, [value]
120
1210,102,152
122
1230,102,102
124
125203,152, [value]
126
127152,152, [value]
128
129102,152, [value]
130
13151,152, [value]
132
133230,134,0
134
135255,51, [value excepting 255]
136
1370,102,51
138
1390,102,0
140
141203,102, [value]
142
143152,102, [value]
144
145102,102, [value]
146
14751,102, [value]
148
149255,0, [value excepting 0]
150
151255,175,19
152
1530,51,255
154
1550,51,203
156
157203,51, [value]
158
159152,51, [value]
160
161102,51, [value]
162
16351,51, [value]
164
165255,203,102 -> 255,203,255, stepping in the [value] increments
166
1670,51, [value, starting at 152]
168
169203,0, [value, excepting 0]
170
171255,227,70
172
173152,0, [value]
174
175102,0, [value]
176
17751,0, [value]
178
179255,203,51
180
181255,203,0
182
183255,255, [values in reverse]
184
185protected: void _SetDefaultGUIColors(void)
186-------------------------------------------
187
188Sets the internal color_set to the defaults, which is the following:
189
190- panel_background: 216,216, 216
191- panel_text: 0,0,0
192- document_background: 255,255,255
193- document_text: 0,0,0
194- control_background: 216,216,216
195- control_text: 0,0,0
196- control_border: 0,0,0
197- control_highlight: 0,0,255
198- tooltip_background:
199- tooltip_text: 0,0,0
200- menu_background: 216,216,216
201- menu_selected_background: 160,160,160
202- menu_text: 0,0,0
203- menu_selected_text: 0,0,0
204- menu_separator_high: 241,241,241
205- menu_separator_low: 186,186,186
206- menu_triggers: 0,0,0
207
208Structures
209==========
210
211.. code-block:: cpp
212
213    color_set {
214        rgb_color panel_background
215        rgb_color panel_text
216        rgb_color document_background
217        rgb_color document_text
218        rgb_color control_background
219        rgb_color control_text
220        rgb_color control_border
221        rgb_color control_highlight
222        rgb_color tooltip_background
223        rgb_color tooltip_text
224        rgb_color menu_background
225        rgb_color menu_selected_background
226        rgb_color menu_text
227        rgb_color menu_selected_text
228        rgb_color menu_separator
229        rgb_color menu_triggers
230    }
231
232