gruvbox-light.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. -- Gruvbox Light Theme for Lumacs
  2. -- Defined in Lua using the theme API
  3. local theme = editor:create_and_register_theme("gruvbox-light")
  4. -- Gruvbox Light color palette
  5. local bg0 = lumacs.Color(251, 241, 199) -- background
  6. local bg1 = lumacs.Color(235, 219, 178) -- background soft
  7. local bg2 = lumacs.Color(213, 196, 161) -- background hard
  8. -- local bg3 = lumacs.Color(189, 174, 147) -- background harder (not explicitly used)
  9. local fg0 = lumacs.Color(40, 40, 40) -- foreground
  10. local fg1 = lumacs.Color(60, 56, 54) -- foreground
  11. local fg2 = lumacs.Color(80, 73, 69) -- foreground
  12. local fg3 = lumacs.Color(102, 92, 84) -- foreground
  13. local fg4 = lumacs.Color(124, 111, 100) -- gray
  14. local red = lumacs.Color(157, 0, 6) -- red
  15. local green = lumacs.Color(121, 116, 14) -- green
  16. local yellow = lumacs.Color(181, 118, 20) -- yellow
  17. local blue = lumacs.Color(7, 102, 120) -- blue
  18. local purple = lumacs.Color(143, 63, 113) -- purple
  19. local aqua = lumacs.Color(66, 123, 88) -- aqua
  20. local orange = lumacs.Color(175, 58, 3) -- orange
  21. -- Set face attributes
  22. local normal_attrs = lumacs.FaceAttributes()
  23. normal_attrs.foreground = fg0
  24. normal_attrs.background = bg0
  25. theme:set_face("normal", normal_attrs)
  26. local keyword_attrs = lumacs.FaceAttributes()
  27. keyword_attrs.foreground = red
  28. keyword_attrs.background = bg0
  29. keyword_attrs.weight = lumacs.FontWeight.Bold
  30. theme:set_face("font-lock-keyword-face", keyword_attrs)
  31. local string_attrs = lumacs.FaceAttributes()
  32. string_attrs.foreground = green
  33. string_attrs.background = bg0
  34. theme:set_face("font-lock-string-face", string_attrs)
  35. local comment_attrs = lumacs.FaceAttributes()
  36. comment_attrs.foreground = fg4
  37. comment_attrs.background = bg0
  38. comment_attrs.slant = lumacs.FontSlant.Italic
  39. theme:set_face("font-lock-comment-face", comment_attrs)
  40. local function_attrs = lumacs.FaceAttributes()
  41. function_attrs.foreground = yellow
  42. function_attrs.background = bg0
  43. theme:set_face("font-lock-function-name-face", function_attrs)
  44. local type_attrs = lumacs.FaceAttributes()
  45. type_attrs.foreground = purple
  46. type_attrs.background = bg0
  47. theme:set_face("font-lock-type-face", type_attrs)
  48. local number_attrs = lumacs.FaceAttributes()
  49. number_attrs.foreground = orange
  50. number_attrs.background = bg0
  51. theme:set_face("font-lock-constant-face", number_attrs)
  52. local constant_attrs = lumacs.FaceAttributes()
  53. constant_attrs.foreground = aqua
  54. constant_attrs.background = bg0
  55. theme:set_face("font-lock-builtin-face", constant_attrs) -- Mapping to builtin for consistency
  56. local error_attrs = lumacs.FaceAttributes()
  57. error_attrs.foreground = red
  58. error_attrs.background = bg1
  59. error_attrs.weight = lumacs.FontWeight.Bold
  60. theme:set_face("error", error_attrs)
  61. local selection_attrs = lumacs.FaceAttributes()
  62. selection_attrs.foreground = fg0
  63. selection_attrs.background = bg2
  64. theme:set_face("region", selection_attrs)
  65. local cursor_attrs = lumacs.FaceAttributes()
  66. cursor_attrs.foreground = bg0
  67. cursor_attrs.background = fg0
  68. theme:set_face("cursor", cursor_attrs)
  69. local statusline_attrs = lumacs.FaceAttributes()
  70. statusline_attrs.foreground = fg1
  71. statusline_attrs.background = bg1
  72. theme:set_face("mode-line", statusline_attrs)
  73. local statusline_inactive_attrs = lumacs.FaceAttributes()
  74. statusline_inactive_attrs.foreground = fg3
  75. statusline_inactive_attrs.background = bg1
  76. theme:set_face("mode-line-inactive", statusline_inactive_attrs)
  77. local line_number_attrs = lumacs.FaceAttributes()
  78. line_number_attrs.foreground = fg4
  79. line_number_attrs.background = bg0
  80. theme:set_face("line-number", line_number_attrs)
  81. local minibuffer_prompt_attrs = lumacs.FaceAttributes()
  82. minibuffer_prompt_attrs.foreground = blue
  83. minibuffer_prompt_attrs.background = bg0
  84. minibuffer_prompt_attrs.weight = lumacs.FontWeight.Bold
  85. theme:set_face("minibuffer-prompt", minibuffer_prompt_attrs)
  86. print(string.format("Theme '%s' loaded.", theme:name()))