Skip to main content

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

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​

KeyRequiredDescription
nameβœ“Theme display name
blurxEnable 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"
}