作者ledia (contemplation)
看板PttSuggest
标题Re: [建议] 类别的颜色
时间Sun Jul 3 02:09:40 2005
※ 引述《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