- 新增 ui/shared.ts 统一 getStatColor 函数 - CompanionCard/SpeciesDetail 改用共享函数,消除重复 - 移除 data/evolution.ts 中已废弃的 EVOLUTION_CHAINS 常量 - 清理 index.ts 导出 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15 lines
320 B
TypeScript
15 lines
320 B
TypeScript
import type { Color } from '@anthropic/ink'
|
|
|
|
const STAT_COLORS: Record<string, Color> = {
|
|
hp: 'ansi:green',
|
|
attack: 'ansi:red',
|
|
defense: 'ansi:yellow',
|
|
spAtk: 'ansi:blue',
|
|
spDef: 'ansi:magenta',
|
|
speed: 'ansi:cyan',
|
|
}
|
|
|
|
export function getStatColor(stat: string): Color {
|
|
return STAT_COLORS[stat] ?? 'ansi:white'
|
|
}
|