初始提交:姜十三论坛 Jiang13 Forum
轻量自用论坛,Go 单二进制 + React SPA 内嵌 + SQLite。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
10
frontend/src/utils/board.ts
Normal file
10
frontend/src/utils/board.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/** 板块图标背景色 */
|
||||
const BOARD_COLORS = ['#2d8a55', '#3498db', '#9b59b6', '#e67e22', '#1abc9c', '#e74c3c', '#34495e'];
|
||||
|
||||
export function boardColor(id: number) {
|
||||
return BOARD_COLORS[id % BOARD_COLORS.length];
|
||||
}
|
||||
|
||||
export function boardInitial(name: string) {
|
||||
return (name?.trim()?.[0] || '?').toUpperCase();
|
||||
}
|
||||
Reference in New Issue
Block a user