aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui-curses.c3
1 files changed, 3 insertions, 0 deletions
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)