1/*cc -o /tmp/setclut setclut.c -framework IOKit -framework ApplicationServices -Wall -g
2*/
3
4#include <ApplicationServices/ApplicationServicesPriv.h>
5
6int main( int argc, char * argv[] )
7{
8    CGSPaletteRef palette;
9    CGSDeviceColor color;
10
11    palette = CGSPaletteCreateDefaultColorPalette();
12
13    while(1)
14    {
15        color.red = 1.0;
16        color.green = 0.0;
17        color.blue = 0.0;
18        CGSPaletteSetColorAtIndex(palette, color, 0);
19        CGSSetDisplayPalette(CGSMainDisplayID(), palette);
20
21        color.red = 0.0;
22        color.green = 1.0;
23        color.blue = 0.0;
24        CGSPaletteSetColorAtIndex(palette, color, 0);
25        CGSSetDisplayPalette(CGSMainDisplayID(), palette);
26    }
27    exit(0);
28}
29
30
31