3
* p_palette for Mac OS X.
5
* Copyright (c) 2000. See accompanying LEGAL file for details.
12
p_palette(p_win *w, unsigned long *colors, int n)
18
if (n > 240) n = 240; /* system reserves 20 colors -- may only get 236 */
20
if (w->parent) w = w->parent;
23
for (i=0 ; i<n ; i++) {
24
w->pixels[i][0] = P_R(colors[i]) / 255.0;
25
w->pixels[i][1] = P_G(colors[i]) / 255.0;
26
w->pixels[i][2] = P_B(colors[i]) / 255.0;
27
w->pixels[i][3] = 1.0;
29
for (; i<w->n_pixels ; i++)
30
{ w->pixels[i][0] = s->sys_colors[255-P_FG][0];
31
w->pixels[i][1] = s->sys_colors[255-P_FG][1];
32
w->pixels[i][2] = s->sys_colors[255-P_FG][2];
33
w->pixels[i][3] = s->sys_colors[255-P_FG][3];