[hackers] [st] Fixing the brightening on bold. For the 256 colors and greyscale I assumed a || Christoph Lohmann

From: <hg_AT_suckless.org>
Date: Fri, 5 Oct 2012 22:53:47 +0200 (CEST)

changeset: 349:bcc37f1f7f6d
tag: tip
user: Christoph Lohmann <20h_AT_r-36.net>
date: Fri Oct 05 22:51:08 2012 +0200
files: st.c
description:
Fixing the brightening on bold. For the 256 colors and greyscale I assumed a
reasonable solution.


diff -r b0c5f18fa666 -r bcc37f1f7f6d st.c
--- a/st.c Fri Oct 05 11:07:55 2012 +0200
+++ b/st.c Fri Oct 05 22:51:08 2012 +0200
_AT_@ -2192,10 +2192,27 @@
 
         if(base.mode & ATTR_REVERSE)
                 temp = fg, fg = bg, bg = temp;
+
         if(base.mode & ATTR_BOLD) {
- fg = &dc.xft_col[base.fg + 8];
+ if(BETWEEN(base.fg, 0, 7)) {
+ /* basic system colors */
+ fg = &dc.xft_col[base.fg + 8];
+ } else if(BETWEEN(base.fg, 16, 195)) {
+ /* 256 colors */
+ fg = &dc.xft_col[base.fg + 36];
+ } else if(BETWEEN(base.fg, 232, 251)) {
+ /* greyscale */
+ fg = &dc.xft_col[base.fg + 4];
+ }
+ /*
+ * Those ranges will not be brightened:
+ * 8 - 15 – bright system colors
+ * 196 - 231 – highest 256 color cube
+ * 252 - 255 – brightest colors in grescale
+ */
                 font = &dc.bfont;
         }
+
         if(base.mode & ATTR_ITALIC)
                 font = &dc.ifont;
         if(base.mode & (ATTR_ITALIC|ATTR_ITALIC))
Received on Fri Oct 05 2012 - 22:53:47 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 05 2012 - 23:00:07 CEST