From 4dff695b496430a751c69bd81f7670e37f9557c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 17 Jan 2016 13:59:54 +0100 Subject: ui: support color definitions in terms of the 256 color palette --- ui-curses.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui-curses.c b/ui-curses.c index 186de58..219e426 100644 --- a/ui-curses.c +++ b/ui-curses.c @@ -450,6 +450,9 @@ static int color_fromstring(const char *s) if (n != 3) return -1; return color_find_rgb(r, g, b); + } else if ('0' <= *s && *s <= '9') { + int col = atoi(s); + return (col <= 0 || col > 255) ? -1 : col; } if (strcasecmp(s, "black") == 0) -- cgit v1.2.3