Skip to content

Commit

Permalink
BREAKING CHANGE: improved performance, styles config use hl group.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmx03 committed Oct 29, 2024
1 parent be281db commit 1eff3e3
Show file tree
Hide file tree
Showing 9 changed files with 1,518 additions and 935 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,23 @@ return {

dracula.setup({
styles = {
types = {},
functions = {},
parameters = {},
comments = {},
strings = {},
keywords = {},
variables = {},
constants = {},
Type = {},
Function = {},
Parameter = {},
Property = {},
Comment = {},
String = {},
Keyword = {},
Identifier = {},
Constant = {},
},
transparent = false,
on_colors = function (colors, color)
---@type dracula.palette
return {
-- override or create new colors
mycolor = "#ffffff",
-- mycolor = 0xffffff,
}
end,
on_highlights = function (colors, color)
Expand Down
556 changes: 555 additions & 1 deletion colors/dracula-soft.lua

Large diffs are not rendered by default.

595 changes: 594 additions & 1 deletion colors/dracula.lua

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions doc/dracula.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ Annotations can be enabled. Below is an example of how to enable them.

dracula.setup({
styles = {
types = {},
functions = {},
parameters = {},
comments = {},
strings = {},
keywords = {},
variables = {},
constants = {},
Type = {},
Function = {},
Parameter = {},
Property = {},
Comment = {},
String = {},
Keyword = {},
Identifier = {},
Constant = {},
},
transparent = false,
on_colors = function (colors, color)
Expand Down
8 changes: 4 additions & 4 deletions lua/barbecue/theme/dracula.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ local M = {
basename = { link = 'Identifier' },
context = { link = 'Identifier' },
context_file = { link = 'Identifier' },
context_module = { link = 'Identifier' },
context_namespace = { link = 'Identifier' },
context_module = { link = 'Type' },
context_namespace = { link = 'Type' },
context_package = { link = 'Directory' },
context_class = { link = 'Type' },
context_method = { link = 'Function' },
context_property = { link = 'Identifier' },
context_field = { link = 'Identifier' },
context_property = { link = 'Property' },
context_field = { link = 'Property' },
context_constructor = { link = 'Type' },
context_enum = { link = 'Type' },
context_interface = { link = 'Type' },
Expand Down
38 changes: 21 additions & 17 deletions lua/dracula/config.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
---@class dracula.styles
---@field types? vim.api.keyset.highlight
---@field functions? vim.api.keyset.highlight
---@field parameters? vim.api.keyset.highlight
---@field comments? vim.api.keyset.highlight
---@field strings? vim.api.keyset.highlight
---@field keywords? vim.api.keyset.highlight
---@field variables? vim.api.keyset.highlight
---@field constants? vim.api.keyset.highlight
---@field Type? vim.api.keyset.highlight
---@field Function? vim.api.keyset.highlight
---@field Parameter? vim.api.keyset.highlight
---@field Property? vim.api.keyset.highlight
---@field Comment? vim.api.keyset.highlight
---@field String? vim.api.keyset.highlight
---@field Keyword? vim.api.keyset.highlight
---@field Identifier? vim.api.keyset.highlight
---@field Constant? vim.api.keyset.highlight

---@class dracula.config
---@field styles dracula.styles
---@field styles? dracula.styles
---@field transparent? boolean
---@field on_highlights? fun(colors: dracula.palette, color: dracula.color): dracula.highlights
---@field on_colors? fun(colors: dracula.palette, color: dracula.color): dracula.palette
return {
styles = {
types = {},
functions = {},
parameters = {},
comments = {},
strings = {},
keywords = {},
variables = {},
constants = {},
Type = {},
Function = {},
Parameter = {},
Property = {},
Comment = {
italic = true,
},
String = {},
Keyword = {},
Identifier = {},
Constant = {},
},
transparent = false,
on_highlights = nil,
Expand Down
Loading

0 comments on commit 1eff3e3

Please sign in to comment.