Look in the folder unix at the file x11u.c.
There is a functionDIGWin *gdx11_create_digwin(xservername,window_width,window_height)
which creates the plotting window.
You should be able to swap the background_pixel and foreground_pixel values after the queries that set them and get what you want. Do that before the call to XCreateWindow( ).