diff options
author | Christoph Lohmann <20h@r-36.net> | 2012-10-05 22:51:08 +0200 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2012-10-05 22:51:08 +0200 |
commit | bf6cf05ba5211b35d7b10169624679428c5f4974 (patch) | |
tree | 86b10e054fd8a0c1bab1c64ab2a1bc3d0302ff5c /st.c | |
parent | 5caa46cf575a48e6421aaf8757e066f6d32263d9 (diff) | |
download | st-bf6cf05ba5211b35d7b10169624679428c5f4974.tar.gz st-bf6cf05ba5211b35d7b10169624679428c5f4974.zip |
Fixing the brightening on bold. For the 256 colors and greyscale I assumed a
reasonable solution.
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -2192,10 +2192,27 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
2192 | 2192 | ||
2193 | if(base.mode & ATTR_REVERSE) | 2193 | if(base.mode & ATTR_REVERSE) |
2194 | temp = fg, fg = bg, bg = temp; | 2194 | temp = fg, fg = bg, bg = temp; |
2195 | |||
2195 | if(base.mode & ATTR_BOLD) { | 2196 | if(base.mode & ATTR_BOLD) { |
2196 | fg = &dc.xft_col[base.fg + 8]; | 2197 | if(BETWEEN(base.fg, 0, 7)) { |
2198 | /* basic system colors */ | ||
2199 | fg = &dc.xft_col[base.fg + 8]; | ||
2200 | } else if(BETWEEN(base.fg, 16, 195)) { | ||
2201 | /* 256 colors */ | ||
2202 | fg = &dc.xft_col[base.fg + 36]; | ||
2203 | } else if(BETWEEN(base.fg, 232, 251)) { | ||
2204 | /* greyscale */ | ||
2205 | fg = &dc.xft_col[base.fg + 4]; | ||
2206 | } | ||
2207 | /* | ||
2208 | * Those ranges will not be brightened: | ||
2209 | * 8 - 15 – bright system colors | ||
2210 | * 196 - 231 – highest 256 color cube | ||
2211 | * 252 - 255 – brightest colors in grescale | ||
2212 | */ | ||
2197 | font = &dc.bfont; | 2213 | font = &dc.bfont; |
2198 | } | 2214 | } |
2215 | |||
2199 | if(base.mode & ATTR_ITALIC) | 2216 | if(base.mode & ATTR_ITALIC) |
2200 | font = &dc.ifont; | 2217 | font = &dc.ifont; |
2201 | if(base.mode & (ATTR_ITALIC|ATTR_ITALIC)) | 2218 | if(base.mode & (ATTR_ITALIC|ATTR_ITALIC)) |