summaryrefslogtreecommitdiffstats
path: root/src/color.c
diff options
context:
space:
mode:
authorBenjamin Titmus <Benjamin.Titmus@arm.com>2020-11-13 21:24:20 +0000
committerBenjamin Titmus <Benjamin.Titmus@arm.com>2020-11-13 21:24:20 +0000
commit3806c6b10abf130d1c06e2d0fb99e9f319986f55 (patch)
tree44efba753feb50fde1c5425dec0730c394ba880a /src/color.c
parentbdd936a12c68f74419e3307760439335e1b18133 (diff)
Add italic option to colors
Diffstat (limited to 'src/color.c')
-rw-r--r--src/color.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/color.c b/src/color.c
index 91632d2..cbbd0e6 100644
--- a/src/color.c
+++ b/src/color.c
@@ -86,6 +86,7 @@ void start_default_ucolors() {
int i;
for (i=0; i < N_INIT_PAIRS; i++) {
ucolors[ i ].bold = 0;
+ ucolors[ i ].italic = 0;
ucolors[ i ].dim = 0;
ucolors[ i ].reverse = 0;
ucolors[ i ].standout = 0;
@@ -291,6 +292,7 @@ void chg_color(char * str) {
ucolors[ type ].fg = atoi(get(d_colors_param, get(d, "fg")));
ucolors[ type ].bg = atoi(get(d_colors_param, get(d, "bg")));
if (((cl = get(d, "bold")) != NULL) && cl[0] != '\0') ucolors[ type ].bold = atoi(get(d, "bold"));
+ if (((cl = get(d, "italic")) != NULL) && cl[0] != '\0') ucolors[ type ].italic = atoi(get(d, "italic"));
if (((cl = get(d, "dim")) != NULL) && cl[0] != '\0') ucolors[ type ].dim = atoi(get(d, "dim"));
if (((cl = get(d, "reverse")) != NULL) && cl[0] != '\0') ucolors[ type ].reverse = atoi(get(d, "reverse"));
if (((cl = get(d, "standout")) != NULL) && cl[0] != '\0') ucolors[ type ].standout = atoi(get(d, "standout"));
@@ -372,6 +374,7 @@ void color_cell(int r, int c, int rf, int cf, char * str) {
n->ucolor->fg = NONE_COLOR;
n->ucolor->bg = NONE_COLOR;
n->ucolor->bold = 0;
+ n->ucolor->italic = 0;
n->ucolor->dim = 0;
n->ucolor->reverse = 0;
n->ucolor->standout = 0;
@@ -386,6 +389,7 @@ void color_cell(int r, int c, int rf, int cf, char * str) {
n->ucolor->fg = atoi(get(d_colors_param, get(d, "fg")));
if ((cl = get(d, "bold")) != NULL && cl[0] != '\0') n->ucolor->bold = atoi(get(d, "bold"));
+ if ((cl = get(d, "italic")) != NULL && cl[0] != '\0') n->ucolor->italic = atoi(get(d, "italic"));
if ((cl = get(d, "dim") ) != NULL && cl[0] != '\0') n->ucolor->dim = atoi(get(d, "dim"));
if ((cl = get(d, "reverse")) != NULL && cl[0] != '\0') n->ucolor->reverse = atoi(get(d, "reverse"));
if ((cl = get(d, "standout")) != NULL && cl[0] != '\0') n->ucolor->standout = atoi(get(d, "standout"));
@@ -486,6 +490,7 @@ int same_ucolor(struct ucolor * u, struct ucolor * v) {
if (u->fg != v->fg) return 0;
if (u->bg != v->bg) return 0;
if (u->bold != v->bold) return 0;
+ if (u->italic != v->italic) return 0;
if (u->dim != v->dim) return 0;
if (u->reverse != v->reverse) return 0;
if (u->standout != v->standout) return 0;