Support dim_inactive with existing integrations

dev
Rahul Garg 2 years ago
parent 60c42920c9
commit 863500ba19
No known key found for this signature in database
GPG Key ID: A7CFFA71DF343888

@ -1,8 +1,13 @@
local M = {} local M = {}
function M.get(cp) function M.get(cp)
local transparent_background = require("catppuccin.config").options.transparent_background local cnf = require("catppuccin.config").options
local bg_highlight = transparent_background and "NONE" or cp.base local transparent_background = cnf.transparent_background
local dim_inactive = cnf.dim_inactive
local bg_highlight = (transparent_background and dim_inactive and cp.dim)
or (transparent_background and "NONE")
or (dim_inactive and cp.dim)
or cp.base
local inactive_bg = transparent_background and "NONE" or cp.mantle local inactive_bg = transparent_background and "NONE" or cp.mantle

@ -1,10 +1,15 @@
local M = {} local M = {}
function M.get(cp) function M.get(cp)
local cnf = require("catppuccin.config").options
local bg_highlight = (cnf.transparent_background and cnf.dim_inactive and cp.dim)
or (cnf.transparent_background and "NONE")
or (cnf.dim_inactive and cp.dim)
or cp.base
return { return {
GitSignsAdd = { fg = cp.green, bg = cnf.transparent_background and cp.none or cp.base }, -- diff mode: Added line |diff.txt| GitSignsAdd = { fg = cp.green, bg = bg_highlight }, -- diff mode: Added line |diff.txt|
GitSignsChange = { fg = cp.yellow, bg = cnf.transparent_background and cp.none or cp.base }, -- diff mode: Changed line |diff.txt| GitSignsChange = { fg = cp.yellow, bg = bg_highlight }, -- diff mode: Changed line |diff.txt|
GitSignsDelete = { fg = cp.red, bg = cnf.transparent_background and cp.none or cp.base }, -- diff mode: Deleted line |diff.txt| GitSignsDelete = { fg = cp.red, bg = bg_highlight }, -- diff mode: Deleted line |diff.txt|
} }
end end

@ -1,16 +1,21 @@
local M = {} local M = {}
function M.get(cp) function M.get(cp)
local transparent_background = require("catppuccin.config").options.transparent_background local cnf = require("catppuccin.config").options
local bg_highlight = transparent_background and "NONE" or cp.base local transparent_background = cnf.transparent_background
local dim_inactive = cnf.dim_inactive
local bg_highlight = (transparent_background and dim_inactive and cp.dim)
or (transparent_background and "NONE")
or (dim_inactive and cp.dim)
or cp.base
return { return {
rainbowcol1 = {bg = bg_highlight, fg = cp.red}, rainbowcol1 = { bg = bg_highlight, fg = cp.red },
rainbowcol2 = {bg = bg_highlight, fg = cp.teal}, rainbowcol2 = { bg = bg_highlight, fg = cp.teal },
rainbowcol3 = {bg = bg_highlight, fg = cp.yellow}, rainbowcol3 = { bg = bg_highlight, fg = cp.yellow },
rainbowcol4 = {bg = bg_highlight, fg = cp.blue}, rainbowcol4 = { bg = bg_highlight, fg = cp.blue },
rainbowcol5 = {bg = bg_highlight, fg = cp.pink}, rainbowcol5 = { bg = bg_highlight, fg = cp.pink },
rainbowcol6 = {bg = bg_highlight, fg = cp.flamingo}, rainbowcol6 = { bg = bg_highlight, fg = cp.flamingo },
rainbowcol7 = {bg = bg_highlight, fg = cp.green}, rainbowcol7 = { bg = bg_highlight, fg = cp.green },
} }
end end

Loading…
Cancel
Save