summaryrefslogtreecommitdiffstats
path: root/colour.c
diff options
context:
space:
mode:
authornicm <nicm>2020-08-25 11:35:32 +0000
committernicm <nicm>2020-08-25 11:35:32 +0000
commit20fcdcfea1651d26990ae482cbc0f3594c4cea54 (patch)
tree0783866907115878eacdcc701b27dc101406e9e1 /colour.c
parente4a4fcfc90b09774cb15b030689e977fefe12678 (diff)
Allow colour to be spelt as color, from Boris Verkhovsky. GitHub issue
2317.
Diffstat (limited to 'colour.c')
-rw-r--r--colour.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/colour.c b/colour.c
index c7972878..ee4b95db 100644
--- a/colour.c
+++ b/colour.c
@@ -189,6 +189,12 @@ colour_fromstring(const char *s)
return (-1);
return (n | COLOUR_FLAG_256);
}
+ if (strncasecmp(s, "color", (sizeof "color") - 1) == 0) {
+ n = strtonum(s + (sizeof "color") - 1, 0, 255, &errstr);
+ if (errstr != NULL)
+ return (-1);
+ return (n | COLOUR_FLAG_256);
+ }
if (strcasecmp(s, "default") == 0)
return (8);