Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(mellifluous): remove bg_contrast option #60

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ Default config:
```lua
require("mellifluous").setup({
mellifluous = {
neutral = true, -- set this to false and bg_contrast to "medium" for original mellifluous (then it was called meliora theme)
bg_contrast = "medium", -- options: "soft", "medium", "hard"
neutral = true, -- set this to false for original mellifluous (when it was called meliora theme)
},
})
```
Expand Down
3 changes: 1 addition & 2 deletions doc/mellifluous.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ Default config:
>lua
require("mellifluous").setup({
mellifluous = {
neutral = true, -- set this to false and bg_contrast to "medium" for original mellifluous (then it was called meliora theme)
bg_contrast = "medium", -- options: "soft", "medium", "hard"
neutral = true, -- set this to false for original mellifluous (when it was called meliora theme)
},
})
<
Expand Down
21 changes: 3 additions & 18 deletions lua/mellifluous/colors/colorsets/mellifluous.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ local colorset_name = "mellifluous"
function M.get_bg_dark()
local config = require("mellifluous.config").config
local mellifluous_config = config[colorset_name]
local is_neutral = mellifluous_config.neutral

local brightness = 11.5
if mellifluous_config.bg_contrast == "hard" then
brightness = brightness - 2
elseif mellifluous_config.bg_contrast == "soft" then
brightness = brightness + 2
end

if is_neutral then
if mellifluous_config.neutral then
return color.new_from_hsl({ h = 0, s = 0, l = brightness })
end
return color.new_from_hsl({ h = 24, s = 10, l = brightness })
Expand All @@ -24,16 +17,9 @@ end
function M.get_bg_light()
local config = require("mellifluous.config").config
local mellifluous_config = config[colorset_name]
local is_neutral = mellifluous_config.neutral

local brightness = 91.5
if mellifluous_config.bg_contrast == "hard" then
brightness = brightness + 2
elseif mellifluous_config.bg_contrast == "soft" then
brightness = brightness - 2
end

if is_neutral then
if mellifluous_config.neutral then
return color.new_from_hsl({ h = 0, s = 0, l = brightness })
end
return color.new_from_hsl({ h = 24, s = 10, l = brightness })
Expand Down Expand Up @@ -113,8 +99,7 @@ end

function M.get_config()
return {
neutral = true, -- set this to false and bg_contrast to 'medium' for original mellifluous (then it was called mellifluous theme)
bg_contrast = "medium", -- options: 'soft', 'medium', 'hard'
neutral = true,
}
end

Expand Down