modified: color

modified:   color.c
This commit is contained in:
Brett Weiland 2020-07-21 16:42:35 -05:00
parent 2f1cb688b0
commit e4d8e80042
2 changed files with 26 additions and 35 deletions

BIN
color

Binary file not shown.

39
color.c
View File

@ -1,37 +1,28 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define START_COLOR 0xffffff int main(void) {
int main() {
Display *display; Display *display;
Window window; Window window;
XEvent event;
int screen; int screen;
d = XOpenDisplay(NULL);
if((display = XOpenDisplay(NULL)) == NULL) { if (d == NULL) {
printf("There was an error opening the screen: %s\n", strerror(errno)); fprintf(stderr, "Cannot open display\n");
exit(errno); exit(1);
} }
screen = DefaultScreen(display); screen = DefaultScreen(display);
w = XCreateSimpleWindow(display, RootWindow(display, screen),
window = XCreateSimpleWindow(
display,
RootWindow(display, screen),
10, 10, 10, 10,
1000, 1000, 100, 100,
0, 1,
BlackPixel(display, screen), BlackPixel(d, s),
WhitePixel(display, screen)); WhitePixel(d, s)); //last arg is color
XMapWindow(display, screen);
XFlush(display);
//github testing
return 0;
} }