summaryrefslogtreecommitdiff
path: root/color.c
blob: d82a1424f19d0f3335a7e67bfe0135621f3391be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
int main(void) {
   Display *display;
   Window window;
   XEvent event;
   int screen;
 
   d = XOpenDisplay(NULL);
   if (d == NULL) {
      fprintf(stderr, "Cannot open display\n");
      exit(1);
   }
 
   screen = DefaultScreen(display);
   w = XCreateSimpleWindow(display, RootWindow(display, screen), 
       10, 10, 
       100, 100, 
       1,
       BlackPixel(d, s), 
       WhitePixel(d, s)); //last arg is color
 
 
   return 0;
}