From 40ac18e27b2d1f96286b5d9a68761d226749c08f Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Mon, 27 Jul 2020 00:49:25 -0500 Subject: modified: bin/color modified: src/color.c --- src/color.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/color.c b/src/color.c index cfe6077..ad21919 100644 --- a/src/color.c +++ b/src/color.c @@ -47,9 +47,9 @@ int redraw_display(update_info *display_summary, XTextItem *text_prompt, GC *gc, display_summary->foreground.blue = 0xffff - display_summary->background.blue; XAllocColor(display_summary->display, display_summary->colormap, &display_summary->foreground); XClearWindow(display_summary->display, display_summary->window); + printf("%i\n", display_summary->background.pixel); XSetWindowBackground(display_summary->display, display_summary->window, display_summary->background.pixel); XSetForeground(display_summary->display, *gc, display_summary->foreground.pixel); - printf("%i\n", display_summary->foreground.red); XDrawText(display_summary->display, display_summary->window, *gc, TEXT_CORNER_OFFSET, textpos_y, text_prompt, 1); } @@ -166,8 +166,10 @@ int main(void) { break; case X_ENTER_KEY: text_prompt_buffer[text_prompt.nchars + 1] = '\0'; - printf("%i: %s\n", strlen(text_prompt_buffer), text_prompt_buffer); + XFreeColors(display, colormap, background_color.pixel, 1, NULL); XParseColor(display, colormap, text_prompt_buffer, &background_color); + background_color.red = 60000; + XAllocColor(display, colormap, &background_color); is_prompt = 0; text_prompt.nchars = 0; redraw_display(&display_summary, &text_prompt, &text_prompt_gc, textpos_y); -- cgit v1.2.3