default.lua 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. -- Default Light Theme for Lumacs
  2. -- Enhanced version with rich styling using all available face attributes and theme elements
  3. local theme = editor:create_and_register_theme("default")
  4. -- Default light color palette
  5. local bg = lumacs.Color(255, 255, 255) -- #ffffff
  6. local fg = lumacs.Color(0, 0, 0) -- #000000
  7. local grey = lumacs.Color(128, 128, 128) -- #808080
  8. local light_bg = lumacs.Color(245, 245, 245) -- #f5f5f5
  9. local dark_bg = lumacs.Color(240, 240, 240) -- #f0f0f0
  10. -- Simple but effective color scheme
  11. local blue = lumacs.Color(0, 0, 255) -- #0000ff
  12. local green = lumacs.Color(0, 128, 0) -- #008000
  13. local red = lumacs.Color(255, 0, 0) -- #ff0000
  14. local purple = lumacs.Color(128, 0, 128) -- #800080
  15. local orange = lumacs.Color(255, 140, 0) -- #ff8c00
  16. local dark_blue = lumacs.Color(0, 0, 139) -- #00008b
  17. local dark_green = lumacs.Color(0, 100, 0) -- #006400
  18. local dark_red = lumacs.Color(139, 0, 0) -- #8b0000
  19. -- === SET ALL THEME ELEMENTS (Complete theming) ===
  20. -- Special elements (base)
  21. theme:set_color(lumacs.ThemeElement.Background, fg, bg)
  22. theme:set_color(lumacs.ThemeElement.Foreground, fg, bg)
  23. theme:set_color(lumacs.ThemeElement.Normal, fg, bg)
  24. -- Text syntax elements
  25. theme:set_color(lumacs.ThemeElement.Keyword, blue, bg)
  26. theme:set_color(lumacs.ThemeElement.String, green, bg)
  27. theme:set_color(lumacs.ThemeElement.Comment, grey, bg)
  28. theme:set_color(lumacs.ThemeElement.Function, dark_blue, bg)
  29. theme:set_color(lumacs.ThemeElement.Type, purple, bg)
  30. theme:set_color(lumacs.ThemeElement.Number, red, bg)
  31. theme:set_color(lumacs.ThemeElement.Constant, purple, bg)
  32. theme:set_color(lumacs.ThemeElement.Variable, fg, bg)
  33. theme:set_color(lumacs.ThemeElement.Builtin, dark_blue, bg)
  34. theme:set_color(lumacs.ThemeElement.Preprocessor, orange, bg)
  35. theme:set_color(lumacs.ThemeElement.Operator, fg, bg)
  36. theme:set_color(lumacs.ThemeElement.Error, bg, red)
  37. theme:set_color(lumacs.ThemeElement.Warning, fg, lumacs.Color(255, 255, 0))
  38. -- UI elements
  39. theme:set_color(lumacs.ThemeElement.StatusLine, fg, light_bg)
  40. theme:set_color(lumacs.ThemeElement.StatusLineInactive, grey, dark_bg)
  41. theme:set_color(lumacs.ThemeElement.MessageLine, fg, bg)
  42. theme:set_color(lumacs.ThemeElement.LineNumber, grey, bg)
  43. theme:set_color(lumacs.ThemeElement.LineNumberCurrent, dark_blue, bg)
  44. theme:set_color(lumacs.ThemeElement.Cursor, bg, fg)
  45. theme:set_color(lumacs.ThemeElement.Selection, bg, blue)
  46. theme:set_color(lumacs.ThemeElement.SearchMatch, fg, lumacs.Color(255, 255, 0))
  47. theme:set_color(lumacs.ThemeElement.SearchFail, bg, red)
  48. theme:set_color(lumacs.ThemeElement.MatchParen, fg, lumacs.Color(0, 255, 0))
  49. -- Minibuffer elements
  50. theme:set_color(lumacs.ThemeElement.MinibufferPrompt, dark_blue, bg)
  51. theme:set_color(lumacs.ThemeElement.MinibufferInput, fg, light_bg)
  52. theme:set_color(lumacs.ThemeElement.MinibufferCompletion, grey, light_bg)
  53. theme:set_color(lumacs.ThemeElement.MinibufferMatch, bg, blue)
  54. -- Window elements
  55. theme:set_color(lumacs.ThemeElement.WindowBorder, grey, bg)
  56. theme:set_color(lumacs.ThemeElement.WindowBorderActive, blue, bg)
  57. theme:set_color(lumacs.ThemeElement.WindowSeparator, grey, bg)
  58. theme:set_color(lumacs.ThemeElement.TabLine, grey, dark_bg)
  59. theme:set_color(lumacs.ThemeElement.TabLineSel, fg, bg)
  60. -- === SYNTAX HIGHLIGHTING FACES (Rich Styling) ===
  61. -- Base default face
  62. local default_face = lumacs.FaceAttributes()
  63. default_face.foreground = fg
  64. default_face.background = bg
  65. default_face.family = "Liberation Mono"
  66. default_face.height = 110 -- 11pt
  67. default_face.weight = lumacs.FontWeight.Normal
  68. default_face.slant = lumacs.FontSlant.Normal
  69. theme:set_face("default", default_face)
  70. -- Keywords (blue, bold)
  71. local keyword_face = lumacs.FaceAttributes()
  72. keyword_face.foreground = blue
  73. keyword_face.weight = lumacs.FontWeight.Bold
  74. keyword_face.inherit = "default"
  75. theme:set_face("font-lock-keyword-face", keyword_face)
  76. -- Strings (green, italic)
  77. local string_face = lumacs.FaceAttributes()
  78. string_face.foreground = green
  79. string_face.slant = lumacs.FontSlant.Italic
  80. string_face.inherit = "default"
  81. theme:set_face("font-lock-string-face", string_face)
  82. -- Comments (grey, italic)
  83. local comment_face = lumacs.FaceAttributes()
  84. comment_face.foreground = grey
  85. comment_face.slant = lumacs.FontSlant.Italic
  86. comment_face.inherit = "default"
  87. theme:set_face("font-lock-comment-face", comment_face)
  88. -- Function names (dark blue, bold)
  89. local function_face = lumacs.FaceAttributes()
  90. function_face.foreground = dark_blue
  91. function_face.weight = lumacs.FontWeight.Bold
  92. function_face.inherit = "default"
  93. theme:set_face("font-lock-function-name-face", function_face)
  94. -- Type names (purple, bold)
  95. local type_face = lumacs.FaceAttributes()
  96. type_face.foreground = purple
  97. type_face.weight = lumacs.FontWeight.Bold
  98. type_face.inherit = "default"
  99. theme:set_face("font-lock-type-face", type_face)
  100. -- === UI FACES (Rich Styling) ===
  101. -- Mode line (status bar)
  102. local modeline_face = lumacs.FaceAttributes()
  103. modeline_face.foreground = fg
  104. modeline_face.background = light_bg
  105. modeline_face.weight = lumacs.FontWeight.Bold
  106. modeline_face.family = "DejaVu Sans"
  107. modeline_face.height = 100
  108. theme:set_face("mode-line", modeline_face)
  109. -- Inactive mode line
  110. local modeline_inactive_face = lumacs.FaceAttributes()
  111. modeline_inactive_face.foreground = grey
  112. modeline_inactive_face.background = dark_bg
  113. modeline_inactive_face.inherit = "mode-line"
  114. theme:set_face("mode-line-inactive", modeline_inactive_face)
  115. -- Minibuffer prompt (dark blue, bold)
  116. local minibuffer_prompt_face = lumacs.FaceAttributes()
  117. minibuffer_prompt_face.foreground = dark_blue
  118. minibuffer_prompt_face.weight = lumacs.FontWeight.Bold
  119. minibuffer_prompt_face.inherit = "default"
  120. theme:set_face("minibuffer-prompt", minibuffer_prompt_face)
  121. -- Line numbers (grey, small)
  122. local line_number_face = lumacs.FaceAttributes()
  123. line_number_face.foreground = grey
  124. line_number_face.background = bg
  125. line_number_face.family = "Liberation Mono"
  126. line_number_face.height = 90
  127. line_number_face.weight = lumacs.FontWeight.Light
  128. theme:set_face("line-number", line_number_face)
  129. -- Current line number (highlighted)
  130. local line_number_current_face = lumacs.FaceAttributes()
  131. line_number_current_face.foreground = dark_blue
  132. line_number_current_face.weight = lumacs.FontWeight.Bold
  133. line_number_current_face.inherit = "line-number"
  134. theme:set_face("line-number-current", line_number_current_face)
  135. -- Selection/region (blue background)
  136. local region_face = lumacs.FaceAttributes()
  137. region_face.foreground = bg
  138. region_face.background = blue
  139. region_face.weight = lumacs.FontWeight.Bold
  140. theme:set_face("region", region_face)
  141. -- Error (red background, bold)
  142. local error_face = lumacs.FaceAttributes()
  143. error_face.foreground = bg
  144. error_face.background = red
  145. error_face.weight = lumacs.FontWeight.Bold
  146. error_face.underline = true
  147. theme:set_face("error", error_face)
  148. -- Warning (orange, bold)
  149. local warning_face = lumacs.FaceAttributes()
  150. warning_face.foreground = orange
  151. warning_face.weight = lumacs.FontWeight.Bold
  152. warning_face.inherit = "default"
  153. theme:set_face("warning", warning_face)
  154. -- Success (green, bold)
  155. local success_face = lumacs.FaceAttributes()
  156. success_face.foreground = dark_green
  157. success_face.weight = lumacs.FontWeight.Bold
  158. success_face.inherit = "default"
  159. theme:set_face("success", success_face)
  160. print(string.format("Enhanced theme '%s' loaded with comprehensive default styling.", theme:name()))