| 变量 | 说明 | 默认用途 |
|---|---|---|
background | 主背景色 | 页面背景 |
foreground | 主前景色 | 文字颜色 |
accent | 强调色 | 品牌紫色,执行模式高亮 |
info | 信息色 | 琥珀色,确认模式、警告 |
success | 成功色 | 绿色 |
destructive | 危险色 | 红色,删除操作 |
| 变量 | 区域 |
|---|---|
paper | AI 消息气泡、卡片等浮出内容 |
navigator | 左侧边栏背景 |
input | 输入框背景 |
popover | 下拉菜单、弹窗、右键菜单 |
popoverSolid | 风景模式下的不透明弹窗背景 |
{
"background": "oklch(0.98 0.003 265)",
"accent": "#8b5cf6",
"info": "hsl(42, 80%, 55%)",
"success": "rgb(74, 182, 107)"
}dark 字段中提供深色模式覆盖值:{
"background": "oklch(0.98 0.003 265)",
"foreground": "oklch(0.185 0.01 270)",
"accent": "oklch(0.58 0.22 293)",
"dark": {
"background": "oklch(0.234 0.008 297)",
"foreground": "oklch(0.95 0.01 270)",
"accent": "oklch(0.750 0.092 39)"
}
}~/.anakin/theme.json 即可覆盖默认颜色:{
"accent": "oklch(0.65 0.20 145)",
"dark": {
"accent": "oklch(0.75 0.18 145)"
}
}~/.anakin/themes/ 目录:~/.anakin/
├── theme.json # 应用级覆盖
└── themes/
├── dracula.json
├── nord.json
└── my-theme.json~/.anakin/config.json 中设置:{
"colorTheme": "dracula"
}{
"name": "Dracula",
"description": "A dark theme inspired by Dracula",
"author": "Zeno Rocha",
"background": "oklch(0.20 0.02 280)",
"foreground": "oklch(0.96 0.01 275)",
"accent": "oklch(0.72 0.18 305)",
"info": "oklch(0.78 0.15 75)",
"success": "oklch(0.75 0.15 145)",
"destructive": "oklch(0.68 0.20 15)",
"shikiTheme": {
"light": "github-light",
"dark": "dracula"
}
}shikiTheme 控制代码块的语法高亮主题。{
"mode": "scenic",
"backgroundImage": "https://example.com/background.jpg",
"paper": "rgba(255, 255, 255, 0.1)",
"navigator": "rgba(0, 0, 0, 0.3)",
"popoverSolid": "#1a1a2e"
}使用风景模式时, popoverSolid必须设置为不透明颜色,避免弹窗背景透明导致文字难以阅读。
config.json 中:{
"defaults": {
"colorTheme": "nord"
}
}