Re: [建議] 類別的顏色
※ 引述《artdeco (阿特爹口)》之銘言:
: 可不可以不要有暗藍色啊?
: 太暗了看不清楚
: 例如:校友 音樂 遊戲 沙灘 娛樂...等等
: 改成校友 娛樂會不會比較好?
: 另外
: 紅色跟紫色怎麼都沒在用?
不知道當初為甚麼只用到
第一色
第二色
第三色
第四色
第五色
第六色
第七色
第八色
這八種顏色而已, 有甚麼特別的理由嗎?
是因為為了節省運算, 只挑八個顏色來 &7 嗎?
沒有這個原因的話可以改一下:
--- board.c.bak Sun Jul 3 02:04:39 2005
+++ board.c Sun Jul 3 02:07:58 2005
@@ -454,13 +454,16 @@
static inline char *
make_class_color(char *name)
{
- char *colorset[8] = {"", ANSI_COLOR(32),
- ANSI_COLOR(33), ANSI_COLOR(36), ANSI_COLOR(34), ANSI_COLOR(1),
- ANSI_COLOR(1;32), ANSI_COLOR(1;33)};
+ char *colorset[14] = {"", ANSI_COLOR(1),
+ ANSI_COLOR(31), ANSI_COLOR(32), ANSI_COLOR(33),
+ ANSI_COLOR(34), ANSI_COLOR(35), ANSI_COLOR(36),
+ ANSI_COLOR(1;31), ANSI_COLOR(1;32), ANSI_COLOR(1;33),
+ ANSI_COLOR(1;34), ANSI_COLOR(1;35), ANSI_COLOR(1;36),
+ };
return colorset[(unsigned int)
(name[0] + name[1] +
- name[2] + name[3]) & 07];
+ name[2] + name[3]) % 14];
}
#define HILIGHT_COLOR ANSI_COLOR(1;36)
@@ -500,9 +503,6 @@
}
if (brdnum > 0) {
boardstat_t *ptr;
- char *color[8] = {"", ANSI_COLOR(32),
- ANSI_COLOR(33), ANSI_COLOR(36), ANSI_COLOR(34), ANSI_COLOR(1),
- ANSI_COLOR(1;32), ANSI_COLOR(1;33)};
char *unread[2] = {ANSI_COLOR(37) " " ANSI_RESET, ANSI_COLOR(1;31) "ˇ" ANSI_RESET};
if (IS_LISTING_FAV() && get_data_number(get_current_fav()) == 0){
@@ -573,9 +573,7 @@
((!(cuser.uflag2 & FAVNOHILIGHT) &&
getboard(ptr->bid) != NULL))? ANSI_COLOR(1;36) : "",
B_BH(ptr)->brdname,
- color[(unsigned int)
- (B_BH(ptr)->title[1] + B_BH(ptr)->title[2] +
- B_BH(ptr)->title[3] + B_BH(ptr)->title[0]) & 07],
+ make_class_color(B_BH(ptr)->title),
B_BH(ptr)->title, B_BH(ptr)->title + 5, B_BH(ptr)->title + 7);
#ifdef USE_COOLDOWN
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.30.55
討論串 (同標題文章)