ayu-dark.lua 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. -- Ayu Dark Theme for Lumacs
  2. -- Enhanced version with rich styling using all available face attributes
  3. -- Based on the popular Ayu color scheme (Dark variant)
  4. local theme = editor:create_and_register_theme("ayu-dark")
  5. -- Ayu Dark color palette
  6. local bg = lumacs.Color(15, 20, 25) -- #0f1419
  7. local bg_darker = lumacs.Color(12, 16, 20) -- #0c1014
  8. local panel_bg = lumacs.Color(20, 25, 31) -- #14191f
  9. local selection_bg = lumacs.Color(33, 42, 51) -- #212a33
  10. local line_bg = lumacs.Color(25, 32, 39) -- #191f27
  11. local guide = lumacs.Color(42, 54, 66) -- #2a3642
  12. local comment = lumacs.Color(92, 99, 112) -- #5c6370
  13. local fg = lumacs.Color(230, 225, 207) -- #e6e1cf
  14. local fg_idle = lumacs.Color(131, 135, 139) -- #83878b
  15. -- Ayu colors
  16. local red = lumacs.Color(242, 151, 142) -- #f2978a
  17. local orange = lumacs.Color(255, 160, 102) -- #ffa066
  18. local yellow = lumacs.Color(255, 214, 138) -- #ffd68a
  19. local green = lumacs.Color(172, 218, 123) -- #acd67b
  20. local cyan = lumacs.Color(149, 230, 203) -- #95e6cb
  21. local blue = lumacs.Color(115, 186, 255) -- #73baff
  22. local purple = lumacs.Color(212, 159, 255) -- #d49fff
  23. local pink = lumacs.Color(255, 140, 204) -- #ff8ccc
  24. -- Additional colors for variety
  25. local dark_red = lumacs.Color(240, 113, 120) -- #f07178
  26. local dark_orange = lumacs.Color(255, 140, 77) -- #ff8c4d
  27. local dark_blue = lumacs.Color(89, 158, 240) -- #599ef0
  28. local bright_fg = lumacs.Color(255, 255, 255) -- #ffffff
  29. -- === SET ALL THEME ELEMENTS (Complete theming) ===
  30. -- Special elements (base)
  31. theme:set_color(lumacs.ThemeElement.Background, fg, bg)
  32. theme:set_color(lumacs.ThemeElement.Foreground, fg, bg)
  33. theme:set_color(lumacs.ThemeElement.Normal, fg, bg)
  34. -- Text syntax elements
  35. theme:set_color(lumacs.ThemeElement.Keyword, purple, bg)
  36. theme:set_color(lumacs.ThemeElement.String, green, bg)
  37. theme:set_color(lumacs.ThemeElement.Comment, comment, bg)
  38. theme:set_color(lumacs.ThemeElement.Function, yellow, bg)
  39. theme:set_color(lumacs.ThemeElement.Type, cyan, bg)
  40. theme:set_color(lumacs.ThemeElement.Number, orange, bg)
  41. theme:set_color(lumacs.ThemeElement.Constant, blue, bg)
  42. theme:set_color(lumacs.ThemeElement.Variable, fg, bg)
  43. theme:set_color(lumacs.ThemeElement.Builtin, red, bg)
  44. theme:set_color(lumacs.ThemeElement.Preprocessor, pink, bg)
  45. theme:set_color(lumacs.ThemeElement.Operator, orange, bg)
  46. theme:set_color(lumacs.ThemeElement.Error, bright_fg, dark_red)
  47. theme:set_color(lumacs.ThemeElement.Warning, bg, yellow)
  48. -- UI elements
  49. theme:set_color(lumacs.ThemeElement.StatusLine, fg, panel_bg)
  50. theme:set_color(lumacs.ThemeElement.StatusLineInactive, fg_idle, bg_darker)
  51. theme:set_color(lumacs.ThemeElement.MessageLine, fg, bg)
  52. theme:set_color(lumacs.ThemeElement.LineNumber, guide, bg)
  53. theme:set_color(lumacs.ThemeElement.LineNumberCurrent, orange, bg)
  54. theme:set_color(lumacs.ThemeElement.Cursor, bg, orange)
  55. theme:set_color(lumacs.ThemeElement.Selection, fg, selection_bg)
  56. theme:set_color(lumacs.ThemeElement.SearchMatch, bg, yellow)
  57. theme:set_color(lumacs.ThemeElement.SearchFail, bright_fg, dark_red)
  58. theme:set_color(lumacs.ThemeElement.MatchParen, bg, cyan)
  59. -- Minibuffer elements
  60. theme:set_color(lumacs.ThemeElement.MinibufferPrompt, blue, bg)
  61. theme:set_color(lumacs.ThemeElement.MinibufferInput, fg, panel_bg)
  62. theme:set_color(lumacs.ThemeElement.MinibufferCompletion, fg_idle, panel_bg)
  63. theme:set_color(lumacs.ThemeElement.MinibufferMatch, bg, purple)
  64. -- Window elements
  65. theme:set_color(lumacs.ThemeElement.WindowBorder, guide, bg)
  66. theme:set_color(lumacs.ThemeElement.WindowBorderActive, blue, bg)
  67. theme:set_color(lumacs.ThemeElement.WindowSeparator, guide, bg)
  68. theme:set_color(lumacs.ThemeElement.TabLine, fg_idle, panel_bg)
  69. theme:set_color(lumacs.ThemeElement.TabLineSel, fg, dark_blue)
  70. -- === SYNTAX HIGHLIGHTING FACES (Rich Styling) ===
  71. -- Base default face
  72. local default_face = lumacs.FaceAttributes()
  73. default_face.foreground = fg
  74. default_face.background = bg
  75. default_face.family = "Source Code Pro"
  76. default_face.height = 110 -- 11pt
  77. default_face.weight = lumacs.FontWeight.Normal
  78. default_face.slant = lumacs.FontSlant.Normal
  79. theme:set_face("default", default_face)
  80. -- Keywords (purple, bold)
  81. local keyword_face = lumacs.FaceAttributes()
  82. keyword_face.foreground = purple
  83. keyword_face.weight = lumacs.FontWeight.Bold
  84. keyword_face.inherit = "default"
  85. theme:set_face("font-lock-keyword-face", keyword_face)
  86. -- Strings (green, italic)
  87. local string_face = lumacs.FaceAttributes()
  88. string_face.foreground = green
  89. string_face.slant = lumacs.FontSlant.Italic
  90. string_face.inherit = "default"
  91. theme:set_face("font-lock-string-face", string_face)
  92. -- Comments (comment, italic, light)
  93. local comment_face = lumacs.FaceAttributes()
  94. comment_face.foreground = comment
  95. comment_face.slant = lumacs.FontSlant.Italic
  96. comment_face.weight = lumacs.FontWeight.Light
  97. comment_face.inherit = "default"
  98. theme:set_face("font-lock-comment-face", comment_face)
  99. -- Function names (yellow, bold)
  100. local function_face = lumacs.FaceAttributes()
  101. function_face.foreground = yellow
  102. function_face.weight = lumacs.FontWeight.Bold
  103. function_face.inherit = "default"
  104. theme:set_face("font-lock-function-name-face", function_face)
  105. -- Type names (cyan, bold)
  106. local type_face = lumacs.FaceAttributes()
  107. type_face.foreground = cyan
  108. type_face.weight = lumacs.FontWeight.Bold
  109. type_face.inherit = "default"
  110. theme:set_face("font-lock-type-face", type_face)
  111. -- Variables (fg, normal)
  112. local variable_face = lumacs.FaceAttributes()
  113. variable_face.foreground = fg
  114. variable_face.inherit = "default"
  115. theme:set_face("font-lock-variable-name-face", variable_face)
  116. -- Constants (blue, bold)
  117. local constant_face = lumacs.FaceAttributes()
  118. constant_face.foreground = blue
  119. constant_face.weight = lumacs.FontWeight.Bold
  120. constant_face.inherit = "default"
  121. theme:set_face("font-lock-constant-face", constant_face)
  122. -- Builtin functions (red, bold, underline)
  123. local builtin_face = lumacs.FaceAttributes()
  124. builtin_face.foreground = red
  125. builtin_face.weight = lumacs.FontWeight.Bold
  126. builtin_face.underline = true
  127. builtin_face.inherit = "default"
  128. theme:set_face("font-lock-builtin-face", builtin_face)
  129. -- === UI FACES (Rich Styling) ===
  130. -- Mode line (status bar)
  131. local modeline_face = lumacs.FaceAttributes()
  132. modeline_face.foreground = fg
  133. modeline_face.background = panel_bg
  134. modeline_face.weight = lumacs.FontWeight.Bold
  135. modeline_face.family = "Helvetica"
  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 = fg_idle
  141. modeline_inactive_face.background = bg_darker
  142. modeline_inactive_face.inherit = "mode-line"
  143. theme:set_face("mode-line-inactive", modeline_inactive_face)
  144. -- Minibuffer prompt (blue, bold)
  145. local minibuffer_prompt_face = lumacs.FaceAttributes()
  146. minibuffer_prompt_face.foreground = blue
  147. minibuffer_prompt_face.weight = lumacs.FontWeight.Bold
  148. minibuffer_prompt_face.inherit = "default"
  149. theme:set_face("minibuffer-prompt", minibuffer_prompt_face)
  150. -- Line numbers (guide, small)
  151. local line_number_face = lumacs.FaceAttributes()
  152. line_number_face.foreground = guide
  153. line_number_face.background = bg
  154. line_number_face.family = "Source Code Pro"
  155. line_number_face.height = 90
  156. line_number_face.weight = lumacs.FontWeight.Light
  157. theme:set_face("line-number", line_number_face)
  158. -- Current line number (highlighted)
  159. local line_number_current_face = lumacs.FaceAttributes()
  160. line_number_current_face.foreground = orange
  161. line_number_current_face.weight = lumacs.FontWeight.Bold
  162. line_number_current_face.inherit = "line-number"
  163. theme:set_face("line-number-current", line_number_current_face)
  164. -- Cursor (inverse, bold)
  165. local cursor_face = lumacs.FaceAttributes()
  166. cursor_face.foreground = bg
  167. cursor_face.background = orange
  168. cursor_face.inverse = true
  169. cursor_face.weight = lumacs.FontWeight.Bold
  170. cursor_face.inherit = "default"
  171. theme:set_face("cursor", cursor_face)
  172. -- Selection/region (selection_bg background)
  173. local region_face = lumacs.FaceAttributes()
  174. region_face.foreground = fg
  175. region_face.background = selection_bg
  176. region_face.weight = lumacs.FontWeight.Bold
  177. theme:set_face("region", region_face)
  178. -- Search matches (yellow background, bold)
  179. local isearch_face = lumacs.FaceAttributes()
  180. isearch_face.foreground = bg
  181. isearch_face.background = yellow
  182. isearch_face.weight = lumacs.FontWeight.Bold
  183. theme:set_face("isearch", isearch_face)
  184. -- Error (red background, bold, underline)
  185. local error_face = lumacs.FaceAttributes()
  186. error_face.foreground = bright_fg
  187. error_face.background = dark_red
  188. error_face.weight = lumacs.FontWeight.Bold
  189. error_face.underline = true
  190. theme:set_face("error", error_face)
  191. -- Warning (yellow, bold)
  192. local warning_face = lumacs.FaceAttributes()
  193. warning_face.foreground = yellow
  194. warning_face.weight = lumacs.FontWeight.Bold
  195. warning_face.inherit = "default"
  196. theme:set_face("warning", warning_face)
  197. -- Success (green, bold)
  198. local success_face = lumacs.FaceAttributes()
  199. success_face.foreground = green
  200. success_face.weight = lumacs.FontWeight.Bold
  201. success_face.inherit = "default"
  202. theme:set_face("success", success_face)
  203. print(string.format("Enhanced theme '%s' loaded with complete Ayu Dark styling.", theme:name()))