Themes
Create, override, or delete UI themes.
File Locationβ
Create a file at:
addons/lyn-themes/lua/lyn/themes/yourthemename.lua
Creating a Themeβ
Return a table with name and color definitions:
Lyn.I18n.Register({
en = {
themes = {
["My Theme"] = "My Theme",
},
},
["zh-cn"] = {
themes = {
["My Theme"] = "ζηδΈ»ι’",
},
},
})
return {
name = "My Theme",
blur = true,
-- Base surfaces
["bg"] = "#1A1B1EBB",
["bg-200"] = "#3E3F42BB",
["bg-300"] = "#2C2D30BB",
["fg"] = "#F0F2F5",
["fg-200"] = "#C5CEDC",
["fg-300"] = "#8A939E",
-- Primary
["primary"] = "#5B21B6",
["primary-200"] = "#6A28D9",
["primary-300"] = "#7537E1",
["primary-fg"] = "#F5F0FF",
["primary-200-fg"] = "#FAF8FF",
["primary-300-fg"] = "#FFFFFF",
-- Accent
["accent"] = "#0A6B75",
["accent-200"] = "#14B8A6",
["accent-fg"] = "#F4FEFF",
["accent-200-fg"] = "#F0FFFF",
-- Error / Success / Warning
["error"] = "#D33732",
["error-fg"] = "#f8f8f2",
["success"] = "#28a745",
["success-fg"] = "#f8fdf9",
["warning"] = "#fcb700",
["warning-fg"] = "#2d2006",
}
Theme Keysβ
| Key | Required | Description |
|---|---|---|
name | β | Theme display name |
blur | x | Enable background blur effect |
bg, bg-200, bg-300 | β | Background colors (dark to light) |
fg, fg-200, fg-300 | β | Foreground/text colors (light to dark) |
primary, primary-200, primary-300 | β | Primary action colors |
primary-fg, primary-200-fg, primary-300-fg | β | Text on primary colors |
accent, accent-200 | β | Accent/highlight colors |
accent-fg, accent-200-fg | β | Text on accent colors |
error, error-fg | β | Error state colors |
success, success-fg | β | Success state colors |
warning, warning-fg | β | Warning state colors |
Colors accept hex strings (#RRGGBB or #RRGGBBAA) or Color():
["bg"] = "#1A1B1EBB",
["bg"] = Color(26, 27, 30, 187),
Overriding a Themeβ
Use the same name as an existing theme. Your values will replace the original:
return {
name = "Blur",
["bg"] = "#000000BB",
["fg"] = "#FFFFFF",
}
Deleting a Themeβ
Return only the name of the theme to delete:
return {
name = "Blur"
}