everforest-dark.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. -- Everforest Dark Theme for Lumacs
  2. -- Enhanced version with rich styling using all available face attributes
  3. -- Defined in Lua using the theme API
  4. local theme = editor:create_and_register_theme("everforest-dark")
  5. -- Everforest color palette (expanded)
  6. local bg0 = lumacs.Color(45, 49, 48) -- #2d3130
  7. local bg1 = lumacs.Color(52, 56, 56) -- #343838
  8. local bg2 = lumacs.Color(58, 62, 62) -- #3a3e3e
  9. local fg = lumacs.Color(211, 198, 170) -- #d3c6aa
  10. -- Syntax colors
  11. local red = lumacs.Color(230, 126, 128) -- #e67e80
  12. local orange = lumacs.Color(230, 152, 117) -- #e69875
  13. local yellow = lumacs.Color(219, 188, 127) -- #dbbc7f
  14. local green = lumacs.Color(167, 192, 128) -- #a7c080
  15. local cyan = lumacs.Color(131, 192, 146) -- #83c092
  16. local blue = lumacs.Color(125, 174, 163) -- #7fbbb3
  17. local purple = lumacs.Color(208, 135, 162) -- #d699b5
  18. local grey = lumacs.Color(146, 131, 116) -- #928374
  19. -- Lighter variants
  20. local red_light = lumacs.Color(240, 146, 148)
  21. local green_light = lumacs.Color(187, 212, 148)
  22. local blue_light = lumacs.Color(145, 194, 183)
  23. -- === SET ALL THEME ELEMENTS (Complete theming) ===
  24. -- Special elements (base)
  25. theme:set_color(lumacs.ThemeElement.Background, fg, bg0)
  26. theme:set_color(lumacs.ThemeElement.Foreground, fg, bg0)
  27. theme:set_color(lumacs.ThemeElement.Normal, fg, bg0)
  28. -- Text syntax elements
  29. theme:set_color(lumacs.ThemeElement.Keyword, red, bg0)
  30. theme:set_color(lumacs.ThemeElement.String, green, bg0)
  31. theme:set_color(lumacs.ThemeElement.Comment, grey, bg0)
  32. theme:set_color(lumacs.ThemeElement.Function, blue, bg0)
  33. theme:set_color(lumacs.ThemeElement.Type, yellow, bg0)
  34. theme:set_color(lumacs.ThemeElement.Number, purple, bg0)
  35. theme:set_color(lumacs.ThemeElement.Constant, orange, bg0)
  36. theme:set_color(lumacs.ThemeElement.Variable, cyan, bg0)
  37. theme:set_color(lumacs.ThemeElement.Builtin, purple, bg0)
  38. theme:set_color(lumacs.ThemeElement.Preprocessor, orange, bg0)
  39. theme:set_color(lumacs.ThemeElement.Operator, red, bg0)
  40. theme:set_color(lumacs.ThemeElement.Error, lumacs.Color(255, 255, 255), red)
  41. theme:set_color(lumacs.ThemeElement.Warning, bg0, orange)
  42. -- UI elements
  43. theme:set_color(lumacs.ThemeElement.StatusLine, bg0, fg)
  44. theme:set_color(lumacs.ThemeElement.StatusLineInactive, grey, bg1)
  45. theme:set_color(lumacs.ThemeElement.MessageLine, fg, bg0)
  46. theme:set_color(lumacs.ThemeElement.LineNumber, grey, bg0)
  47. theme:set_color(lumacs.ThemeElement.LineNumberCurrent, yellow, bg0)
  48. theme:set_color(lumacs.ThemeElement.Cursor, bg0, fg)
  49. theme:set_color(lumacs.ThemeElement.Selection, lumacs.Color(255, 255, 255), blue)
  50. theme:set_color(lumacs.ThemeElement.SearchMatch, bg0, yellow)
  51. theme:set_color(lumacs.ThemeElement.SearchFail, lumacs.Color(255, 255, 255), red)
  52. theme:set_color(lumacs.ThemeElement.MatchParen, bg0, green_light)
  53. -- Minibuffer elements
  54. theme:set_color(lumacs.ThemeElement.MinibufferPrompt, cyan, bg0)
  55. theme:set_color(lumacs.ThemeElement.MinibufferInput, fg, bg1)
  56. theme:set_color(lumacs.ThemeElement.MinibufferCompletion, fg, bg1)
  57. theme:set_color(lumacs.ThemeElement.MinibufferMatch, bg0, blue)
  58. -- Window elements
  59. theme:set_color(lumacs.ThemeElement.WindowBorder, grey, bg0)
  60. theme:set_color(lumacs.ThemeElement.WindowBorderActive, cyan, bg0)
  61. theme:set_color(lumacs.ThemeElement.WindowSeparator, grey, bg0)
  62. theme:set_color(lumacs.ThemeElement.TabLine, grey, bg1)
  63. theme:set_color(lumacs.ThemeElement.TabLineSel, fg, green)
  64. -- === SYNTAX HIGHLIGHTING FACES (Rich Styling) ===
  65. -- Base default face
  66. local default_face = lumacs.FaceAttributes()
  67. default_face.foreground = fg
  68. default_face.background = bg0
  69. default_face.family = "Fira Code"
  70. default_face.height = 110 -- 11pt
  71. default_face.weight = lumacs.FontWeight.Normal
  72. default_face.slant = lumacs.FontSlant.Normal
  73. theme:set_face("default", default_face)
  74. -- Keywords (bold, red)
  75. local keyword_face = lumacs.FaceAttributes()
  76. keyword_face.foreground = red
  77. keyword_face.weight = lumacs.FontWeight.Bold
  78. keyword_face.inherit = "default"
  79. theme:set_face("font-lock-keyword-face", keyword_face)
  80. -- Strings (green, italic)
  81. local string_face = lumacs.FaceAttributes()
  82. string_face.foreground = green
  83. string_face.slant = lumacs.FontSlant.Italic
  84. string_face.inherit = "default"
  85. theme:set_face("font-lock-string-face", string_face)
  86. -- Comments (grey, italic, lighter weight)
  87. local comment_face = lumacs.FaceAttributes()
  88. comment_face.foreground = grey
  89. comment_face.slant = lumacs.FontSlant.Italic
  90. comment_face.weight = lumacs.FontWeight.Light
  91. comment_face.inherit = "default"
  92. theme:set_face("font-lock-comment-face", comment_face)
  93. -- Function names (blue, bold)
  94. local function_face = lumacs.FaceAttributes()
  95. function_face.foreground = blue
  96. function_face.weight = lumacs.FontWeight.Bold
  97. function_face.inherit = "default"
  98. theme:set_face("font-lock-function-name-face", function_face)
  99. -- Type names (yellow, bold)
  100. local type_face = lumacs.FaceAttributes()
  101. type_face.foreground = yellow
  102. type_face.weight = lumacs.FontWeight.Bold
  103. type_face.inherit = "default"
  104. theme:set_face("font-lock-type-face", type_face)
  105. -- Variables (cyan, normal)
  106. local variable_face = lumacs.FaceAttributes()
  107. variable_face.foreground = cyan
  108. variable_face.inherit = "default"
  109. theme:set_face("font-lock-variable-name-face", variable_face)
  110. -- Constants (orange, bold)
  111. local constant_face = lumacs.FaceAttributes()
  112. constant_face.foreground = orange
  113. constant_face.weight = lumacs.FontWeight.Bold
  114. constant_face.inherit = "default"
  115. theme:set_face("font-lock-constant-face", constant_face)
  116. -- Builtin functions (purple, bold)
  117. local builtin_face = lumacs.FaceAttributes()
  118. builtin_face.foreground = purple
  119. builtin_face.weight = lumacs.FontWeight.Bold
  120. builtin_face.inherit = "default"
  121. theme:set_face("font-lock-builtin-face", builtin_face)
  122. -- Preprocessor (orange, bold, underline)
  123. local preprocessor_face = lumacs.FaceAttributes()
  124. preprocessor_face.foreground = orange
  125. preprocessor_face.weight = lumacs.FontWeight.Bold
  126. preprocessor_face.underline = true
  127. preprocessor_face.inherit = "default"
  128. theme:set_face("font-lock-preprocessor-face", preprocessor_face)
  129. -- === UI FACES (Rich Styling) ===
  130. -- Mode line (status bar) - bold, inverted
  131. local modeline_face = lumacs.FaceAttributes()
  132. modeline_face.foreground = bg0
  133. modeline_face.background = fg
  134. modeline_face.weight = lumacs.FontWeight.Bold
  135. modeline_face.family = "Sans"
  136. modeline_face.height = 100
  137. theme:set_face("mode-line", modeline_face)
  138. -- Inactive mode line
  139. local modeline_inactive_face = lumacs.FaceAttributes()
  140. modeline_inactive_face.foreground = grey
  141. modeline_inactive_face.background = bg1
  142. modeline_inactive_face.weight = lumacs.FontWeight.Normal
  143. modeline_inactive_face.inherit = "mode-line"
  144. theme:set_face("mode-line-inactive", modeline_inactive_face)
  145. -- Minibuffer prompt (cyan, bold)
  146. local minibuffer_prompt_face = lumacs.FaceAttributes()
  147. minibuffer_prompt_face.foreground = cyan
  148. minibuffer_prompt_face.weight = lumacs.FontWeight.Bold
  149. minibuffer_prompt_face.inherit = "default"
  150. theme:set_face("minibuffer-prompt", minibuffer_prompt_face)
  151. -- Line numbers (grey, small)
  152. local line_number_face = lumacs.FaceAttributes()
  153. line_number_face.foreground = grey
  154. line_number_face.background = bg0
  155. line_number_face.family = "Fira Code"
  156. line_number_face.height = 90 -- Smaller than main text
  157. line_number_face.weight = lumacs.FontWeight.Light
  158. theme:set_face("line-number", line_number_face)
  159. -- Current line number (highlighted)
  160. local line_number_current_face = lumacs.FaceAttributes()
  161. line_number_current_face.foreground = yellow
  162. line_number_current_face.weight = lumacs.FontWeight.Bold
  163. line_number_current_face.inherit = "line-number"
  164. theme:set_face("line-number-current", line_number_current_face)
  165. -- Cursor (inverse, bold)
  166. local cursor_face = lumacs.FaceAttributes()
  167. cursor_face.foreground = bg0
  168. cursor_face.background = fg
  169. cursor_face.inverse = true
  170. cursor_face.weight = lumacs.FontWeight.Bold
  171. cursor_face.inherit = "default"
  172. theme:set_face("cursor", cursor_face)
  173. -- Selection/region (blue background, bold)
  174. local region_face = lumacs.FaceAttributes()
  175. region_face.foreground = lumacs.Color(255, 255, 255)
  176. region_face.background = blue
  177. region_face.weight = lumacs.FontWeight.Bold
  178. theme:set_face("region", region_face)
  179. -- Search matches (yellow background, bold)
  180. local isearch_face = lumacs.FaceAttributes()
  181. isearch_face.foreground = bg0
  182. isearch_face.background = yellow
  183. isearch_face.weight = lumacs.FontWeight.Bold
  184. theme:set_face("isearch", isearch_face)
  185. -- Failed search (red background, bold)
  186. local isearch_fail_face = lumacs.FaceAttributes()
  187. isearch_fail_face.foreground = lumacs.Color(255, 255, 255)
  188. isearch_fail_face.background = red
  189. isearch_fail_face.weight = lumacs.FontWeight.Bold
  190. isearch_fail_face.underline = true
  191. theme:set_face("isearch-fail", isearch_fail_face)
  192. -- === ERROR AND WARNING FACES ===
  193. -- Error (red background, white text, bold, underline)
  194. local error_face = lumacs.FaceAttributes()
  195. error_face.foreground = lumacs.Color(255, 255, 255)
  196. error_face.background = red
  197. error_face.weight = lumacs.FontWeight.Bold
  198. error_face.underline = true
  199. theme:set_face("error", error_face)
  200. -- Warning (orange, bold)
  201. local warning_face = lumacs.FaceAttributes()
  202. warning_face.foreground = orange
  203. warning_face.weight = lumacs.FontWeight.Bold
  204. warning_face.inherit = "default"
  205. theme:set_face("warning", warning_face)
  206. -- Success (green, bold)
  207. local success_face = lumacs.FaceAttributes()
  208. success_face.foreground = green
  209. success_face.weight = lumacs.FontWeight.Bold
  210. success_face.inherit = "default"
  211. theme:set_face("success", success_face)
  212. -- === WINDOW AND UI ELEMENTS ===
  213. -- Window borders
  214. local window_divider_face = lumacs.FaceAttributes()
  215. window_divider_face.foreground = grey
  216. window_divider_face.background = bg0
  217. theme:set_face("window-divider", window_divider_face)
  218. -- Active window border (highlighted)
  219. local window_divider_active_face = lumacs.FaceAttributes()
  220. window_divider_active_face.foreground = cyan
  221. window_divider_active_face.background = bg0
  222. window_divider_active_face.weight = lumacs.FontWeight.Bold
  223. theme:set_face("window-divider-active", window_divider_active_face)
  224. -- === COMPLETION AND MINIBUFFER ===
  225. -- Completion candidates
  226. local completion_face = lumacs.FaceAttributes()
  227. completion_face.foreground = fg
  228. completion_face.background = bg1
  229. completion_face.inherit = "default"
  230. theme:set_face("completions-common-part", completion_face)
  231. -- Highlighted completion
  232. local completion_selected_face = lumacs.FaceAttributes()
  233. completion_selected_face.foreground = bg0
  234. completion_selected_face.background = blue
  235. completion_selected_face.weight = lumacs.FontWeight.Bold
  236. theme:set_face("completions-first-difference", completion_selected_face)
  237. print(string.format("Enhanced theme '%s' loaded with rich styling.", theme:name()))