diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-01-17 13:59:54 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-01-17 13:59:54 +0100 |
| commit | 4dff695b496430a751c69bd81f7670e37f9557c9 (patch) | |
| tree | 50fc25a63d5b86c7808f2cb04899759bfcf75bcc | |
| parent | 1bfa6448be9afc09d05a94145027a8d099a1cbbc (diff) | |
| download | vis-4dff695b496430a751c69bd81f7670e37f9557c9.tar.gz vis-4dff695b496430a751c69bd81f7670e37f9557c9.tar.xz | |
ui: support color definitions in terms of the 256 color palette
| -rw-r--r-- | ui-curses.c | 3 |
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) |
