Index: uspace/lib/ui/include/ui/paint.h
===================================================================
--- uspace/lib/ui/include/ui/paint.h	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
+++ uspace/lib/ui/include/ui/paint.h	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2020 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Painting routines
+ */
+
+#ifndef _UI_PAINT_H
+#define _UI_PAINT_H
+
+#include <errno.h>
+#include <gfx/color.h>
+#include <gfx/coord.h>
+
+errno_t ui_paint_bevel(gfx_context_t *, gfx_rect_t *, gfx_color_t *,
+    gfx_color_t *, gfx_coord_t, gfx_rect_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/ui/meson.build
===================================================================
--- uspace/lib/ui/meson.build	(revision 8ef48ece717476a9d162affd18ffa54f6f946249)
+++ uspace/lib/ui/meson.build	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
@@ -29,4 +29,5 @@
 deps = [ 'gfx', 'gfxfont' ]
 src = files(
+	'src/paint.c',
 	'src/pbutton.c',
 	'src/resource.c',
@@ -35,4 +36,5 @@
 test_src = files(
 	'test/main.c',
+	'test/paint.c',
 	'test/pbutton.c',
 	'test/resource.c',
Index: uspace/lib/ui/private/resource.h
===================================================================
--- uspace/lib/ui/private/resource.h	(revision 8ef48ece717476a9d162affd18ffa54f6f946249)
+++ uspace/lib/ui/private/resource.h	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
@@ -38,4 +38,5 @@
 #define _UI_PRIVATE_RESOURCE_H
 
+#include <gfx/color.h>
 #include <gfx/context.h>
 #include <gfx/font.h>
@@ -53,4 +54,15 @@
 	/** Font */
 	gfx_font_t *font;
+
+	/** Button frame color */
+	gfx_color_t *btn_frame_color;
+	/** Button face color */
+	gfx_color_t *btn_face_color;
+	/** Button text color */
+	gfx_color_t *btn_text_color;
+	/** Button highlight color */
+	gfx_color_t *btn_highlight_color;
+	/** Button shadow color */
+	gfx_color_t *btn_shadow_color;
 };
 
Index: uspace/lib/ui/src/paint.c
===================================================================
--- uspace/lib/ui/src/paint.c	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
+++ uspace/lib/ui/src/paint.c	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2020 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Painting routines
+ */
+
+#include <errno.h>
+#include <gfx/color.h>
+#include <gfx/context.h>
+#include <gfx/render.h>
+#include <ui/paint.h>
+
+/** Paint bevel.
+ *
+ * @param gc Graphic context
+ * @param rect Rectangle to paint into
+ * @param tlcolor Top-left color
+ * @param brcolor Bottom-right color
+ * @param thickness Bevel thickness in pixels
+ * @param inside Place to store rectangle of the interior or @c NULL
+ * @reutrn EOK on success or an error code
+ */
+errno_t ui_paint_bevel(gfx_context_t *gc, gfx_rect_t *rect,
+    gfx_color_t *tlcolor, gfx_color_t *brcolor, gfx_coord_t thickness,
+    gfx_rect_t *inside)
+{
+	gfx_rect_t frect;
+	gfx_coord_t i;
+	errno_t rc;
+
+	/* Top left */
+
+	rc = gfx_set_color(gc, tlcolor);
+	if (rc != EOK)
+		goto error;
+
+	for (i = 0; i < thickness; i++) {
+		frect.p0.x = rect->p0.x + i;
+		frect.p0.y = rect->p0.y + i;
+		frect.p1.x = rect->p1.x - i - 1;
+		frect.p1.y = rect->p0.y + i + 1;
+		rc = gfx_fill_rect(gc, &frect);
+		if (rc != EOK)
+			goto error;
+
+		frect.p0.x = rect->p0.x + i;
+		frect.p0.y = rect->p0.y + i + 1;
+		frect.p1.x = rect->p0.x + i + 1;
+		frect.p1.y = rect->p1.y - i - 1;
+		rc = gfx_fill_rect(gc, &frect);
+		if (rc != EOK)
+			goto error;
+	}
+
+	/* Bottom right */
+
+	rc = gfx_set_color(gc, brcolor);
+	if (rc != EOK)
+		goto error;
+
+	for (i = 0; i < thickness; i++) {
+		frect.p0.x = rect->p0.x + i;
+		frect.p0.y = rect->p1.y - i - 1;
+		frect.p1.x = rect->p1.x - i - 1;
+		frect.p1.y = rect->p1.y - i;
+		rc = gfx_fill_rect(gc, &frect);
+		if (rc != EOK)
+			goto error;
+
+		frect.p0.x = rect->p1.x - i - 1;
+		frect.p0.y = rect->p0.y + i;
+		frect.p1.x = rect->p1.x - i;
+		frect.p1.y = rect->p1.y - i;
+		rc = gfx_fill_rect(gc, &frect);
+		if (rc != EOK)
+			goto error;
+	}
+
+	if (inside != NULL) {
+		inside->p0.x = rect->p0.x + thickness;
+		inside->p0.y = rect->p0.y + thickness;
+		inside->p1.x = rect->p1.x - thickness;
+		inside->p1.y = rect->p1.y - thickness;
+	}
+
+	return EOK;
+error:
+	return rc;
+}
+
+/** @}
+ */
Index: uspace/lib/ui/src/pbutton.c
===================================================================
--- uspace/lib/ui/src/pbutton.c	(revision 8ef48ece717476a9d162affd18ffa54f6f946249)
+++ uspace/lib/ui/src/pbutton.c	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
@@ -42,4 +42,5 @@
 #include <stdlib.h>
 #include <str.h>
+#include <ui/paint.h>
 #include <ui/pbutton.h>
 #include "../private/pbutton.h"
@@ -133,5 +134,4 @@
 static errno_t ui_pbutton_paint_frame(ui_pbutton_t *pbutton)
 {
-	gfx_color_t *color = NULL;
 	gfx_rect_t rect;
 	gfx_coord_t thickness;
@@ -140,9 +140,5 @@
 	thickness = pbutton->isdefault ? 2 : 1;
 
-	rc = gfx_color_new_rgb_i16(0, 0, 0, &color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_set_color(pbutton->res->gc, color);
+	rc = gfx_set_color(pbutton->res->gc, pbutton->res->btn_frame_color);
 	if (rc != EOK)
 		goto error;
@@ -180,9 +176,6 @@
 		goto error;
 
-	gfx_color_delete(color);
 	return EOK;
 error:
-	if (color != NULL)
-		gfx_color_delete(color);
 	return rc;
 }
@@ -196,75 +189,7 @@
     gfx_rect_t *rect)
 {
-	gfx_color_t *color = NULL;
-	gfx_rect_t frect;
-	gfx_coord_t i;
-	errno_t rc;
-
-	/* Highlight */
-
-	rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_set_color(pbutton->res->gc, color);
-	if (rc != EOK)
-		goto error;
-
-	for (i = 0; i < 2; i++) {
-		frect.p0.x = rect->p0.x + i;
-		frect.p0.y = rect->p0.y + i;
-		frect.p1.x = rect->p1.x - i - 1;
-		frect.p1.y = rect->p0.y + i + 1;
-		rc = gfx_fill_rect(pbutton->res->gc, &frect);
-		if (rc != EOK)
-			goto error;
-
-		frect.p0.x = rect->p0.x + i;
-		frect.p0.y = rect->p0.y + i + 1;
-		frect.p1.x = rect->p0.x + i + 1;
-		frect.p1.y = rect->p1.y - i - 1;
-		rc = gfx_fill_rect(pbutton->res->gc, &frect);
-		if (rc != EOK)
-			goto error;
-	}
-
-	gfx_color_delete(color);
-	color = NULL;
-
-	/* Shadow */
-
-	rc = gfx_color_new_rgb_i16(0x8888, 0x8888, 0x8888, &color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_set_color(pbutton->res->gc, color);
-	if (rc != EOK)
-		goto error;
-
-	for (i = 0; i < 2; i++) {
-		frect.p0.x = rect->p0.x + i;
-		frect.p0.y = rect->p1.y - i - 1;
-		frect.p1.x = rect->p1.x - i - 1;
-		frect.p1.y = rect->p1.y - i;
-		rc = gfx_fill_rect(pbutton->res->gc, &frect);
-		if (rc != EOK)
-			goto error;
-
-		frect.p0.x = rect->p1.x - i - 1;
-		frect.p0.y = rect->p0.y + i;
-		frect.p1.x = rect->p1.x - i;
-		frect.p1.y = rect->p1.y - i;
-		rc = gfx_fill_rect(pbutton->res->gc, &frect);
-		if (rc != EOK)
-			goto error;
-	}
-
-	gfx_color_delete(color);
-
-	return EOK;
-error:
-	if (color != NULL)
-		gfx_color_delete(color);
-	return rc;
+	return ui_paint_bevel(pbutton->res->gc, rect,
+	    pbutton->res->btn_highlight_color,
+	    pbutton->res->btn_shadow_color, 2, NULL);
 }
 
@@ -277,39 +202,7 @@
     gfx_rect_t *rect)
 {
-	gfx_color_t *color = NULL;
-	gfx_rect_t frect;
-	errno_t rc;
-
-	rc = gfx_color_new_rgb_i16(0x8888, 0x8888, 0x8888, &color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_set_color(pbutton->res->gc, color);
-	if (rc != EOK)
-		goto error;
-
-	frect.p0.x = rect->p0.x;
-	frect.p0.y = rect->p0.y;
-	frect.p1.x = rect->p1.x;
-	frect.p1.y = rect->p0.y + 2;
-	rc = gfx_fill_rect(pbutton->res->gc, &frect);
-	if (rc != EOK)
-		goto error;
-
-	frect.p0.x = rect->p0.x;
-	frect.p0.y = rect->p0.y + 2;
-	frect.p1.x = rect->p0.x + 2;
-	frect.p1.y = rect->p1.y;
-	rc = gfx_fill_rect(pbutton->res->gc, &frect);
-	if (rc != EOK)
-		goto error;
-
-	gfx_color_delete(color);
-
-	return EOK;
-error:
-	if (color != NULL)
-		gfx_color_delete(color);
-	return rc;
+	return ui_paint_bevel(pbutton->res->gc, rect,
+	    pbutton->res->btn_shadow_color,
+	    pbutton->res->btn_face_color, 2, NULL);
 }
 
@@ -321,5 +214,4 @@
 errno_t ui_pbutton_paint(ui_pbutton_t *pbutton)
 {
-	gfx_color_t *color = NULL;
 	gfx_coord2_t pos;
 	gfx_text_fmt_t fmt;
@@ -337,24 +229,13 @@
 	rect.p1.y = pbutton->rect.p1.y - thickness;
 
-	rc = gfx_color_new_rgb_i16(0xc8c8, 0xc8c8, 0xc8c8, &color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_set_color(pbutton->res->gc, color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_fill_rect(pbutton->res->gc, &rect);
-	if (rc != EOK)
-		goto error;
-
-	gfx_color_delete(color);
-	color = NULL;
-
-	rc = gfx_color_new_rgb_i16(0, 0, 0, &color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_set_color(pbutton->res->gc, color);
+	rc = gfx_set_color(pbutton->res->gc, pbutton->res->btn_face_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_fill_rect(pbutton->res->gc, &rect);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_set_color(pbutton->res->gc, pbutton->res->btn_text_color);
 	if (rc != EOK)
 		goto error;
@@ -376,7 +257,4 @@
 	if (rc != EOK)
 		goto error;
-
-	gfx_color_delete(color);
-	color = NULL;
 
 	rc = ui_pbutton_paint_frame(pbutton);
@@ -396,6 +274,4 @@
 	return EOK;
 error:
-	if (color != NULL)
-		gfx_color_delete(color);
 	return rc;
 }
Index: uspace/lib/ui/src/resource.c
===================================================================
--- uspace/lib/ui/src/resource.c	(revision 8ef48ece717476a9d162affd18ffa54f6f946249)
+++ uspace/lib/ui/src/resource.c	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
@@ -59,4 +59,9 @@
 	gfx_font_t *font = NULL;
 	gfx_font_info_t *finfo;
+	gfx_color_t *btn_frame_color = NULL;
+	gfx_color_t *btn_face_color = NULL;
+	gfx_color_t *btn_text_color = NULL;
+	gfx_color_t *btn_highlight_color = NULL;
+	gfx_color_t *btn_shadow_color = NULL;
 	errno_t rc;
 
@@ -79,10 +84,46 @@
 		goto error;
 
+	rc = gfx_color_new_rgb_i16(0, 0, 0, &btn_frame_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_color_new_rgb_i16(0xc8c8, 0xc8c8, 0xc8c8, &btn_face_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_color_new_rgb_i16(0, 0, 0, &btn_text_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff,
+	    &btn_highlight_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_color_new_rgb_i16(0x8888, 0x8888, 0x8888, &btn_shadow_color);
+	if (rc != EOK)
+		goto error;
+
 	resource->gc = gc;
 	resource->tface = tface;
 	resource->font = font;
+	resource->btn_frame_color = btn_frame_color;
+	resource->btn_face_color = btn_face_color;
+	resource->btn_text_color = btn_text_color;
+	resource->btn_highlight_color = btn_highlight_color;
+	resource->btn_shadow_color = btn_shadow_color;
 	*rresource = resource;
 	return EOK;
 error:
+	if (btn_frame_color != NULL)
+		gfx_color_delete(btn_frame_color);
+	if (btn_face_color != NULL)
+		gfx_color_delete(btn_face_color);
+	if (btn_text_color != NULL)
+		gfx_color_delete(btn_text_color);
+	if (btn_highlight_color != NULL)
+		gfx_color_delete(btn_highlight_color);
+	if (btn_shadow_color != NULL)
+		gfx_color_delete(btn_shadow_color);
 	if (tface != NULL)
 		gfx_typeface_destroy(tface);
@@ -100,4 +141,10 @@
 		return;
 
+	gfx_color_delete(resource->btn_frame_color);
+	gfx_color_delete(resource->btn_face_color);
+	gfx_color_delete(resource->btn_text_color);
+	gfx_color_delete(resource->btn_highlight_color);
+	gfx_color_delete(resource->btn_shadow_color);
+
 	gfx_font_close(resource->font);
 	gfx_typeface_destroy(resource->tface);
Index: uspace/lib/ui/test/main.c
===================================================================
--- uspace/lib/ui/test/main.c	(revision 8ef48ece717476a9d162affd18ffa54f6f946249)
+++ uspace/lib/ui/test/main.c	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
@@ -31,4 +31,5 @@
 PCUT_INIT;
 
+PCUT_IMPORT(paint);
 PCUT_IMPORT(pbutton);
 PCUT_IMPORT(resource);
Index: uspace/lib/ui/test/paint.c
===================================================================
--- uspace/lib/ui/test/paint.c	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
+++ uspace/lib/ui/test/paint.c	(revision de9992c5dcfe392011d18f6d641c7151c514607a)
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2020 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gfx/context.h>
+#include <gfx/coord.h>
+#include <mem.h>
+#include <pcut/pcut.h>
+#include <stdbool.h>
+#include <ui/paint.h>
+
+PCUT_INIT;
+
+PCUT_TEST_SUITE(paint);
+
+static errno_t testgc_set_color(void *, gfx_color_t *);
+static errno_t testgc_fill_rect(void *, gfx_rect_t *);
+static errno_t testgc_bitmap_create(void *, gfx_bitmap_params_t *,
+    gfx_bitmap_alloc_t *, void **);
+static errno_t testgc_bitmap_destroy(void *);
+static errno_t testgc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
+static errno_t testgc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
+
+static gfx_context_ops_t ops = {
+	.set_color = testgc_set_color,
+	.fill_rect = testgc_fill_rect,
+	.bitmap_create = testgc_bitmap_create,
+	.bitmap_destroy = testgc_bitmap_destroy,
+	.bitmap_render = testgc_bitmap_render,
+	.bitmap_get_alloc = testgc_bitmap_get_alloc
+};
+
+typedef struct {
+	bool bm_created;
+	bool bm_destroyed;
+	gfx_bitmap_params_t bm_params;
+	void *bm_pixels;
+	gfx_rect_t bm_srect;
+	gfx_coord2_t bm_offs;
+	bool bm_rendered;
+	bool bm_got_alloc;
+} test_gc_t;
+
+typedef struct {
+	test_gc_t *tgc;
+	gfx_bitmap_alloc_t alloc;
+	bool myalloc;
+} testgc_bitmap_t;
+
+/** Paint bevel */
+PCUT_TEST(bevel)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	gfx_rect_t rect;
+	gfx_color_t *color1;
+	gfx_color_t *color2;
+	gfx_rect_t inside;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_color_new_rgb_i16(1, 2, 3, &color1);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_color_new_rgb_i16(4, 5, 6, &color2);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Paint bevel with NULL 'inside' output parameter */
+	rc = ui_paint_bevel(gc, &rect, color1, color2, 2, NULL);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Paint bevel with valid 'inside' output parameter */
+	rc = ui_paint_bevel(gc, &rect, color1, color2, 2, &inside);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_color_delete(color2);
+	gfx_color_delete(color1);
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+static errno_t testgc_set_color(void *arg, gfx_color_t *color)
+{
+	(void) arg;
+	(void) color;
+	return EOK;
+}
+
+static errno_t testgc_fill_rect(void *arg, gfx_rect_t *rect)
+{
+	(void) arg;
+	(void) rect;
+	return EOK;
+}
+
+static errno_t testgc_bitmap_create(void *arg, gfx_bitmap_params_t *params,
+    gfx_bitmap_alloc_t *alloc, void **rbm)
+{
+	test_gc_t *tgc = (test_gc_t *) arg;
+	testgc_bitmap_t *tbm;
+
+	tbm = calloc(1, sizeof(testgc_bitmap_t));
+	if (tbm == NULL)
+		return ENOMEM;
+
+	if (alloc == NULL) {
+		tbm->alloc.pitch = (params->rect.p1.x - params->rect.p0.x) *
+		    sizeof(uint32_t);
+		tbm->alloc.off0 = 0;
+		tbm->alloc.pixels = calloc(sizeof(uint32_t),
+		    (params->rect.p1.x - params->rect.p0.x) *
+		    (params->rect.p1.y - params->rect.p0.y));
+		tbm->myalloc = true;
+		if (tbm->alloc.pixels == NULL) {
+			free(tbm);
+			return ENOMEM;
+		}
+	} else {
+		tbm->alloc = *alloc;
+	}
+
+	tbm->tgc = tgc;
+	tgc->bm_created = true;
+	tgc->bm_params = *params;
+	tgc->bm_pixels = tbm->alloc.pixels;
+	*rbm = (void *)tbm;
+	return EOK;
+}
+
+static errno_t testgc_bitmap_destroy(void *bm)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	if (tbm->myalloc)
+		free(tbm->alloc.pixels);
+	tbm->tgc->bm_destroyed = true;
+	free(tbm);
+	return EOK;
+}
+
+static errno_t testgc_bitmap_render(void *bm, gfx_rect_t *srect,
+    gfx_coord2_t *offs)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	tbm->tgc->bm_rendered = true;
+	tbm->tgc->bm_srect = *srect;
+	tbm->tgc->bm_offs = *offs;
+	return EOK;
+}
+
+static errno_t testgc_bitmap_get_alloc(void *bm, gfx_bitmap_alloc_t *alloc)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	*alloc = tbm->alloc;
+	tbm->tgc->bm_got_alloc = true;
+	return EOK;
+}
+
+PCUT_EXPORT(paint);
