From 4d163227c753f0ab791808622e6b714ba3c0d35d Mon Sep 17 00:00:00 2001
From: Jonathan Schleifer <js@webkeks.org>
Date: Thu, 8 Nov 2012 21:59:54 +0100
Subject: [PATCH] Terminal: Use brighter colors instead of bold.
---
src/apps/terminal/TermView.cpp | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp
index 7e7c089..0870b5c 100644
a
|
b
|
TermView::_DrawLinePart(int32 x1, int32 y1, uint32 attr, char *buf,
|
1172 | 1172 | |
1173 | 1173 | inView->SetHighColor(rgb_fore); |
1174 | 1174 | |
1175 | | // Draw character. |
1176 | | inView->MovePenTo(x1, y1 + fFontAscent); |
1177 | | inView->DrawString((char *) buf); |
1178 | | |
1179 | | // bold attribute. |
1180 | 1175 | if (IS_BOLD(attr)) { |
1181 | | inView->MovePenTo(x1 + 1, y1 + fFontAscent); |
| 1176 | #define BRIGHT_ADD 64 |
| 1177 | #define SATTURATED_ADD(var, add) \ |
| 1178 | do { \ |
| 1179 | if (255 - var >= add) \ |
| 1180 | var += add; \ |
| 1181 | else \ |
| 1182 | var = 255; \ |
| 1183 | } while (0) |
| 1184 | |
| 1185 | rgb_color bright = rgb_fore; |
| 1186 | |
| 1187 | SATTURATED_ADD(bright.red, BRIGHT_ADD); |
| 1188 | SATTURATED_ADD(bright.green, BRIGHT_ADD); |
| 1189 | SATTURATED_ADD(bright.blue, BRIGHT_ADD); |
1182 | 1190 | |
1183 | | inView->SetDrawingMode(B_OP_OVER); |
1184 | | inView->DrawString((char *)buf); |
1185 | | inView->SetDrawingMode(B_OP_COPY); |
| 1191 | inView->SetHighColor(bright); |
| 1192 | |
| 1193 | #undef BRIGHT_ADD |
| 1194 | #undef SATTURATED_ADD |
1186 | 1195 | } |
1187 | 1196 | |
| 1197 | // Draw character. |
| 1198 | inView->MovePenTo(x1, y1 + fFontAscent); |
| 1199 | inView->DrawString((char *) buf); |
| 1200 | |
1188 | 1201 | // underline attribute |
1189 | 1202 | if (IS_UNDER(attr)) { |
1190 | 1203 | inView->MovePenTo(x1, y1 + fFontAscent); |