summaryrefslogtreecommitdiffstats
path: root/colour.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-01-21 08:23:12 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-01-21 08:23:12 +0000
commit7f24020cbe477548795754f2f7f01aafc2cd3cb8 (patch)
tree72aeccafa2b025a7c4e2df90769988a2599c8472 /colour.c
parentbe7b56a6137847823bfb56f35d1d92f29f2650ad (diff)
Add strings to allow the aixterm bright colours to be used when
configuring colours, requested by Elliott Cable a few months ago.
Diffstat (limited to 'colour.c')
-rw-r--r--colour.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/colour.c b/colour.c
index ae69e88f..ff492687 100644
--- a/colour.c
+++ b/colour.c
@@ -170,6 +170,22 @@ colour_tostring(int c)
return ("white");
case 8:
return ("default");
+ case 90:
+ return ("brightblack");
+ case 91:
+ return ("brightred");
+ case 92:
+ return ("brightgreen");
+ case 93:
+ return ("brightyellow");
+ case 94:
+ return ("brightblue");
+ case 95:
+ return ("brightmagenta");
+ case 96:
+ return ("brightcyan");
+ case 97:
+ return ("brightwhite");
}
return (NULL);
}
@@ -219,6 +235,30 @@ colour_fromstring(const char *s)
return (7);
if (strcasecmp(s, "default") == 0 || (s[0] == '8' && s[1] == '\0'))
return (8);
+ if (strcasecmp(s, "brightblack") == 0 ||
+ (s[0] == '9' && s[1] == '0' && s[1] == '\0'))
+ return (90);
+ if (strcasecmp(s, "brightred") == 0 ||
+ (s[0] == '9' && s[1] == '1' && s[1] == '\0'))
+ return (91);
+ if (strcasecmp(s, "brightgreen") == 0 ||
+ (s[0] == '9' && s[1] == '2' && s[1] == '\0'))
+ return (92);
+ if (strcasecmp(s, "brightyellow") == 0 ||
+ (s[0] == '9' && s[1] == '3' && s[1] == '\0'))
+ return (93);
+ if (strcasecmp(s, "brightblue") == 0 ||
+ (s[0] == '9' && s[1] == '4' && s[1] == '\0'))
+ return (94);
+ if (strcasecmp(s, "brightmagenta") == 0 ||
+ (s[0] == '9' && s[1] == '5' && s[1] == '\0'))
+ return (95);
+ if (strcasecmp(s, "brightcyan") == 0 ||
+ (s[0] == '9' && s[1] == '6' && s[1] == '\0'))
+ return (96);
+ if (strcasecmp(s, "brightwhite") == 0 ||
+ (s[0] == '9' && s[1] == '7' && s[1] == '\0'))
+ return (97);
return (-1);
}