diff options
| author | Anders Eurenius <aes@spotify.com> | 2014-06-22 00:10:59 +0200 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2014-07-08 22:46:55 +0200 |
| commit | f796533b1bab9aa8ea4e70b79d305c9aea47fe6a (patch) | |
| tree | dd7920ff24d35c33a5ac31a272bdd9bb3a62e0e2 | |
| parent | 955923b38b1f08f6cb25a706cea2af5966339187 (diff) | |
| download | st-f796533b1bab9aa8ea4e70b79d305c9aea47fe6a.tar.gz st-f796533b1bab9aa8ea4e70b79d305c9aea47fe6a.zip | |
Render faint attribute
Faint text is implemented by allocating a new color at one-half
intensity of each of the r, g, b components, or if the text bold at the
same time, it is not made lighter.
Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
Signed-off-by: Christoph Lohmann <20h@r-36.net>
| -rw-r--r-- | st.c | 10 |
1 files changed, 9 insertions, 1 deletions
| @@ -3179,7 +3179,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3179 | * change basic system colors [0-7] | 3179 | * change basic system colors [0-7] |
| 3180 | * to bright system colors [8-15] | 3180 | * to bright system colors [8-15] |
| 3181 | */ | 3181 | */ |
| 3182 | if(BETWEEN(base.fg, 0, 7)) | 3182 | if(BETWEEN(base.fg, 0, 7) && !(base.mode & ATTR_FAINT)) |
| 3183 | fg = &dc.col[base.fg + 8]; | 3183 | fg = &dc.col[base.fg + 8]; |
| 3184 | 3184 | ||
| 3185 | if(base.mode & ATTR_ITALIC) { | 3185 | if(base.mode & ATTR_ITALIC) { |
| @@ -3223,6 +3223,14 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3223 | bg = temp; | 3223 | bg = temp; |
| 3224 | } | 3224 | } |
| 3225 | 3225 | ||
| 3226 | if(base.mode & ATTR_FAINT && !(base.mode & ATTR_BOLD)) { | ||
| 3227 | colfg.red = fg->color.red / 2; | ||
| 3228 | colfg.green = fg->color.green / 2; | ||
| 3229 | colfg.blue = fg->color.blue / 2; | ||
| 3230 | XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &revfg); | ||
| 3231 | fg = &revfg; | ||
| 3232 | } | ||
| 3233 | |||
| 3226 | if(base.mode & ATTR_BLINK && term.mode & MODE_BLINK) | 3234 | if(base.mode & ATTR_BLINK && term.mode & MODE_BLINK) |
| 3227 | fg = bg; | 3235 | fg = bg; |
| 3228 | 3236 | ||
