Index: uspace/app/fontedit/fontedit.c
===================================================================
--- uspace/app/fontedit/fontedit.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/app/fontedit/fontedit.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -446,9 +446,10 @@
  * @param fedit Font editor
  * @param x Starting X coordinate
- * @Param y Starting Y coordinate
+ * @param y Starting Y coordinate
+ * @param color Color
  * @param str String
  */
 static errno_t font_edit_paint_preview_str(font_edit_t *fedit,
-    gfx_coord_t x, gfx_coord_t y, const char *str)
+    gfx_coord_t x, gfx_coord_t y, gfx_color_t *color, const char *str)
 {
 	gfx_text_fmt_t fmt;
@@ -456,4 +457,5 @@
 
 	gfx_text_fmt_init(&fmt);
+	fmt.color = color;
 
 	pos.x = x;
@@ -480,25 +482,25 @@
 		goto error;
 
-	rc = font_edit_paint_preview_str(fedit, 20, 20,
+	rc = font_edit_paint_preview_str(fedit, 20, 20, color,
 	    "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
 	if (rc != EOK)
 		goto error;
 
-	rc = font_edit_paint_preview_str(fedit, 20, 40,
+	rc = font_edit_paint_preview_str(fedit, 20, 40, color,
 	    "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG");
 	if (rc != EOK)
 		goto error;
 
-	rc = font_edit_paint_preview_str(fedit, 20, 60,
+	rc = font_edit_paint_preview_str(fedit, 20, 60, color,
 	    "abcdefghijklmnopqrstuvwxyz");
 	if (rc != EOK)
 		goto error;
 
-	rc = font_edit_paint_preview_str(fedit, 20, 80,
+	rc = font_edit_paint_preview_str(fedit, 20, 80, color,
 	    "the quick brown fox jumps over the lazy dog");
 	if (rc != EOK)
 		goto error;
 
-	rc = font_edit_paint_preview_str(fedit, 20, 100,
+	rc = font_edit_paint_preview_str(fedit, 20, 100, color,
 	    "0123456789,./<>?;'\\:\"|[]{}`~!@#$%^&*()-_=+");
 	if (rc != EOK)
Index: uspace/app/gfxdemo/gfxdemo.c
===================================================================
--- uspace/app/gfxdemo/gfxdemo.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/app/gfxdemo/gfxdemo.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -556,9 +556,6 @@
 		goto error;
 
-	rc = gfx_set_color(gc, color);
-	if (rc != EOK)
-		goto error;
-
 	gfx_text_fmt_init(&fmt);
+	fmt.color = color;
 
 	pos.x = rect.p0.x;
@@ -640,7 +637,5 @@
 			goto error;
 
-		rc = gfx_set_color(gc, color);
-		if (rc != EOK)
-			goto error;
+		fmt.color = color;
 
 		pos.x = w / 20;
Index: uspace/lib/gfxfont/include/types/gfx/text.h
===================================================================
--- uspace/lib/gfxfont/include/types/gfx/text.h	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/gfxfont/include/types/gfx/text.h	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -38,4 +38,5 @@
 
 #include <types/gfx/coord.h>
+#include <types/gfx/color.h>
 
 /** Text horizontal alignment */
@@ -65,4 +66,6 @@
 /** Text formatting */
 typedef struct {
+	/** Text color */
+	gfx_color_t *color;
 	/** Horizontal alignment */
 	gfx_halign_t halign;
Index: uspace/lib/gfxfont/src/text.c
===================================================================
--- uspace/lib/gfxfont/src/text.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/gfxfont/src/text.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -36,6 +36,8 @@
 #include <errno.h>
 #include <gfx/bitmap.h>
+#include <gfx/color.h>
 #include <gfx/font.h>
 #include <gfx/glyph.h>
+#include <gfx/render.h>
 #include <gfx/text.h>
 #include <io/pixelmap.h>
@@ -97,9 +99,10 @@
  * @param font Font
  * @param pos Position of top-left corner of text
+ * @param color Text color
  * @param str String
  * @return EOK on success or an error code
  */
 static errno_t gfx_puttext_textmode(gfx_font_t *font, gfx_coord2_t *pos,
-    const char *str)
+    gfx_color_t *color, const char *str)
 {
 	gfx_context_t *gc = font->typeface->gc;
@@ -107,4 +110,5 @@
 	gfx_bitmap_t *bitmap;
 	gfx_bitmap_alloc_t alloc;
+	uint16_t r, g, b;
 	pixelmap_t pmap;
 	gfx_coord_t x;
@@ -116,4 +120,14 @@
 	 * the most efficient way.
 	 */
+
+	gfx_color_get_rgb_i16(color, &r, &g, &b);
+
+	/*
+	 * We are setting the *background* color, the foreground color
+	 * will be set to its complement.
+	 */
+	r = 0xff ^ (r >> 8);
+	g = 0xff ^ (g >> 8);
+	b = 0xff ^ (b >> 8);
 
 	gfx_bitmap_params_init(&params);
@@ -138,5 +152,5 @@
 
 	for (x = 0; x < params.rect.p1.x; x++) {
-		pixel = PIXEL(str[x], 0xff, 0xff, 0xff);
+		pixel = PIXEL(str[x], r, g, b);
 		pixelmap_put_pixel(&pmap, x, 0, pixel);
 	}
@@ -206,5 +220,9 @@
 	/* Text mode */
 	if ((font->finfo->props.flags & gff_text_mode) != 0)
-		return gfx_puttext_textmode(font, &cpos, str);
+		return gfx_puttext_textmode(font, &cpos, fmt->color, str);
+
+	rc = gfx_set_color(font->typeface->gc, fmt->color);
+	if (rc != EOK)
+		return rc;
 
 	cp = str;
Index: uspace/lib/gfxfont/test/text.c
===================================================================
--- uspace/lib/gfxfont/test/text.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/gfxfont/test/text.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -27,4 +27,5 @@
  */
 
+#include <gfx/color.h>
 #include <gfx/context.h>
 #include <gfx/font.h>
@@ -110,4 +111,5 @@
 	gfx_font_t *font;
 	gfx_context_t *gc;
+	gfx_color_t *color;
 	gfx_text_fmt_t fmt;
 	gfx_coord2_t pos;
@@ -118,4 +120,7 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
+	rc = gfx_color_new_rgb_i16(0, 0, 0, &color);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
 	rc = gfx_typeface_create(gc, &tface);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -127,4 +132,5 @@
 
 	gfx_text_fmt_init(&fmt);
+	fmt.color = color;
 	pos.x = 0;
 	pos.y = 0;
@@ -135,4 +141,5 @@
 	gfx_font_close(font);
 	gfx_typeface_destroy(tface);
+	gfx_color_delete(color);
 
 	rc = gfx_context_delete(gc);
Index: uspace/lib/ui/src/checkbox.c
===================================================================
--- uspace/lib/ui/src/checkbox.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/ui/src/checkbox.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -192,11 +192,7 @@
 
 		gfx_text_fmt_init(&fmt);
+		fmt.color = checkbox->res->entry_fg_color;
 		fmt.halign = gfx_halign_center;
 		fmt.valign = gfx_valign_center;
-
-		rc = gfx_set_color(checkbox->res->gc,
-		    checkbox->res->entry_fg_color);
-		if (rc != EOK)
-			goto error;
 
 		rc = gfx_puttext(checkbox->res->font, &box_center, &fmt, "X");
@@ -207,13 +203,9 @@
 	/* Paint checkbox label */
 
-	rc = gfx_set_color(checkbox->res->gc, checkbox->res->wnd_text_color);
-	if (rc != EOK)
-		goto error;
-
-	/* Label position */
 	pos.x = box_rect.p1.x + checkbox_label_margin;
 	pos.y = (box_rect.p0.y + box_rect.p1.y) / 2;
 
 	gfx_text_fmt_init(&fmt);
+	fmt.color = checkbox->res->wnd_text_color;
 	fmt.halign = gfx_halign_left;
 	fmt.valign = gfx_valign_center;
Index: uspace/lib/ui/src/entry.c
===================================================================
--- uspace/lib/ui/src/entry.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/ui/src/entry.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -208,10 +208,7 @@
 
 	gfx_text_fmt_init(&fmt);
+	fmt.color = entry->res->entry_fg_color;
 	fmt.halign = entry->halign;
 	fmt.valign = gfx_valign_top;
-
-	rc = gfx_set_color(entry->res->gc, entry->res->entry_fg_color);
-	if (rc != EOK)
-		goto error;
 
 	rc = gfx_puttext(entry->res->font, &pos, &fmt, entry->text);
Index: uspace/lib/ui/src/label.c
===================================================================
--- uspace/lib/ui/src/label.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/ui/src/label.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -193,10 +193,7 @@
 
 	gfx_text_fmt_init(&fmt);
+	fmt.color = label->res->wnd_text_color;
 	fmt.halign = label->halign;
 	fmt.valign = gfx_valign_top;
-
-	rc = gfx_set_color(label->res->gc, label->res->wnd_text_color);
-	if (rc != EOK)
-		goto error;
 
 	rc = gfx_puttext(label->res->font, &pos, &fmt, label->text);
Index: uspace/lib/ui/src/pbutton.c
===================================================================
--- uspace/lib/ui/src/pbutton.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/ui/src/pbutton.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -269,8 +269,4 @@
 		goto error;
 
-	rc = gfx_set_color(pbutton->res->gc, pbutton->res->btn_text_color);
-	if (rc != EOK)
-		goto error;
-
 	/* Center of button rectangle */
 	pos.x = (rect.p0.x + rect.p1.x) / 2;
@@ -283,4 +279,5 @@
 
 	gfx_text_fmt_init(&fmt);
+	fmt.color = pbutton->res->btn_text_color;
 	fmt.halign = gfx_halign_center;
 	fmt.valign = gfx_valign_center;
Index: uspace/lib/ui/src/rbutton.c
===================================================================
--- uspace/lib/ui/src/rbutton.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/ui/src/rbutton.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -274,14 +274,9 @@
 	/* Paint rbutton label */
 
-	rc = gfx_set_color(rbutton->group->res->gc,
-	    rbutton->group->res->wnd_text_color);
-	if (rc != EOK)
-		goto error;
-
-	/* Label position */
 	pos.x = center.x + rbutton_oframe_r + rbutton_label_margin;
 	pos.y = center.y;
 
 	gfx_text_fmt_init(&fmt);
+	fmt.color = rbutton->group->res->wnd_text_color;
 	fmt.halign = gfx_halign_left;
 	fmt.valign = gfx_valign_center;
Index: uspace/lib/ui/src/wdecor.c
===================================================================
--- uspace/lib/ui/src/wdecor.c	(revision fe40b67572ac2e5cccf0f269ed3eef05152f67f1)
+++ uspace/lib/ui/src/wdecor.c	(revision b433f680f34a7d7efa45fd40a984f289825e59b4)
@@ -213,4 +213,7 @@
 
 		gfx_text_fmt_init(&fmt);
+		fmt.color = wdecor->active ?
+		    wdecor->res->tbar_act_text_color :
+		    wdecor->res->tbar_inact_text_color;
 		fmt.halign = gfx_halign_center;
 		fmt.valign = gfx_valign_center;
@@ -218,10 +221,4 @@
 		pos.x = (trect.p0.x + trect.p1.x) / 2;
 		pos.y = (trect.p0.y + trect.p1.y) / 2;
-
-		rc = gfx_set_color(wdecor->res->gc, wdecor->active ?
-		    wdecor->res->tbar_act_text_color :
-		    wdecor->res->tbar_inact_text_color);
-		if (rc != EOK)
-			return rc;
 
 		rc = gfx_puttext(wdecor->res->font, &pos, &fmt, wdecor->caption);
