TronCode Tron CLI 主题

内置主题

Tron 内置了多款精心设计的主题,涵盖深色和浅色风格,满足不同审美偏好:

主题名称 风格 说明
catppuccin 深色 默认主题,柔和的莫哈咖啡色调
dracula 深色 经典暗色,紫色调高亮
nord 深色 北欧风格,冷调蓝灰色系
solarized-dark 深色 Solarized 深色版,低对比度护眼
solarized-light 浅色 Solarized 浅色版,适合白天使用
gruvbox 深色 复古暖色调,橙棕色系
tokyo-night 深色 东京夜晚风格,霓虹蓝紫色调

可以在 TUI 中使用 /theme 命令实时预览各个主题的效果,切换后立即生效。

设置主题

在 TUI 中使用 /theme <name> 命令临时切换主题:

Tron TUI
/theme dracula
主题已切换为 dracula
/theme
catppuccin dracula nord solarized-dark solarized-light gruvbox tokyo-night

要持久化主题设置,在 config.json 中添加 theme 配置项:

json
// ~/.config/tron/config.json
{
  "theme": "dracula"
}

自定义主题

你可以创建自定义主题文件来定义独特的配色方案。主题文件为 JSON 格式,存放在 ~/.config/tron/themes/ 目录下:

json
// ~/.config/tron/themes/my-theme.json
{
  "name": "my-theme",
  "background": "#1a1a2e",
  "foreground": "#e8e8f0",
  "primary": "#7c6af5",
  "secondary": "#4fc3f7",
  "success": "#a6e3a1",
  "warning": "#fab387",
  "error": "#f38ba8",
  "comment": "#6c7086",
  "border": "#2a2a3e"
}

保存后,使用 /theme my-theme 即可应用你的自定义主题。

终端颜色适配

Tron 的主题系统与终端本身的配色方案相互独立,但为了获得最佳视觉效果,建议选择与终端主题相协调的 Tron 主题。

推荐搭配方案:

  • Catppuccin 终端主题 + catppuccin Tron 主题
  • Dracula 终端主题 + dracula Tron 主题
  • Nord 终端主题 + nord Tron 主题
  • Gruvbox 终端主题 + gruvbox Tron 主题
💡
提示

如果终端支持真彩色(24-bit color),Tron 主题的颜色将更加准确鲜艳。可以运行 tput colors 检查终端颜色支持情况。