solarized-dark.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. -- Solarized Dark Theme for Lumacs
  2. -- Defined in Lua using the theme API
  3. local theme = editor:create_and_register_theme("solarized-dark")
  4. -- Solarized Dark color palette
  5. local base03 = lumacs.Color(0, 43, 54) -- background
  6. local base02 = lumacs.Color(7, 54, 66) -- background highlights
  7. local base01 = lumacs.Color(88, 110, 117) -- comments / secondary content
  8. local base0 = lumacs.Color(101, 123, 131) -- body text / default code / primary content
  9. local base1 = lumacs.Color(147, 161, 161) -- optional emphasized content
  10. -- local base2 = lumacs.Color(238, 232, 213) -- background highlights (not used in dark theme)
  11. -- local base3 = lumacs.Color(253, 246, 227) -- background (not used in dark theme)
  12. local yellow = lumacs.Color(181, 137, 0) -- constants
  13. local orange = lumacs.Color(203, 75, 22) -- regex, numbers
  14. local red = lumacs.Color(220, 50, 47) -- keywords
  15. local magenta = lumacs.Color(211, 54, 130) -- strings
  16. local violet = lumacs.Color(108, 113, 196) -- functions
  17. local blue = lumacs.Color(38, 139, 210) -- variables
  18. local cyan = lumacs.Color(42, 161, 152) -- special
  19. local green = lumacs.Color(133, 153, 0) -- types
  20. -- Set face attributes using the modern face system
  21. local normal_attrs = lumacs.FaceAttributes()
  22. normal_attrs.foreground = base0
  23. normal_attrs.background = base03
  24. theme:set_face("normal", normal_attrs)
  25. local keyword_attrs = lumacs.FaceAttributes()
  26. keyword_attrs.foreground = red
  27. keyword_attrs.background = base03
  28. keyword_attrs.weight = lumacs.FontWeight.Bold
  29. theme:set_face("font-lock-keyword-face", keyword_attrs)
  30. local string_attrs = lumacs.FaceAttributes()
  31. string_attrs.foreground = magenta
  32. string_attrs.background = base03
  33. theme:set_face("font-lock-string-face", string_attrs)
  34. local comment_attrs = lumacs.FaceAttributes()
  35. comment_attrs.foreground = base01
  36. comment_attrs.background = base03
  37. comment_attrs.slant = lumacs.FontSlant.Italic
  38. theme:set_face("font-lock-comment-face", comment_attrs)
  39. local function_attrs = lumacs.FaceAttributes()
  40. function_attrs.foreground = violet
  41. function_attrs.background = base03
  42. theme:set_face("font-lock-function-name-face", function_attrs)
  43. local type_attrs = lumacs.FaceAttributes()
  44. type_attrs.foreground = green
  45. type_attrs.background = base03
  46. theme:set_face("font-lock-type-face", type_attrs)
  47. local number_attrs = lumacs.FaceAttributes()
  48. number_attrs.foreground = orange
  49. number_attrs.background = base03
  50. theme:set_face("font-lock-constant-face", number_attrs) -- Number is mapped to constant face
  51. local constant_attrs = lumacs.FaceAttributes()
  52. constant_attrs.foreground = yellow
  53. constant_attrs.background = base03
  54. theme:set_face("font-lock-builtin-face", constant_attrs) -- Assuming constants might be builtin
  55. local error_attrs = lumacs.FaceAttributes()
  56. error_attrs.foreground = red
  57. error_attrs.background = base02
  58. error_attrs.weight = lumacs.FontWeight.Bold
  59. theme:set_face("error", error_attrs)
  60. local selection_attrs = lumacs.FaceAttributes()
  61. selection_attrs.foreground = base0
  62. selection_attrs.background = base02
  63. theme:set_face("region", selection_attrs)
  64. local cursor_attrs = lumacs.FaceAttributes()
  65. cursor_attrs.foreground = base03
  66. cursor_attrs.background = base0
  67. theme:set_face("cursor", cursor_attrs)
  68. local statusline_attrs = lumacs.FaceAttributes()
  69. statusline_attrs.foreground = base1
  70. statusline_attrs.background = base02
  71. theme:set_face("mode-line", statusline_attrs)
  72. local statusline_inactive_attrs = lumacs.FaceAttributes()
  73. statusline_inactive_attrs.foreground = base01
  74. statusline_inactive_attrs.background = base02
  75. theme:set_face("mode-line-inactive", statusline_inactive_attrs)
  76. local line_number_attrs = lumacs.FaceAttributes()
  77. line_number_attrs.foreground = base01
  78. line_number_attrs.background = base03
  79. theme:set_face("line-number", line_number_attrs)
  80. local minibuffer_prompt_attrs = lumacs.FaceAttributes()
  81. minibuffer_prompt_attrs.foreground = cyan
  82. minibuffer_prompt_attrs.background = base03
  83. minibuffer_prompt_attrs.weight = lumacs.FontWeight.Bold
  84. theme:set_face("minibuffer-prompt", minibuffer_prompt_attrs)
  85. print(string.format("Theme '%s' loaded.", theme:name()))