Skip to content

Commit cf6a4c8

Browse files
committed
fix: Finished adding remaining highlight groups
1 parent 000b473 commit cf6a4c8

File tree

6 files changed

+296
-293
lines changed

6 files changed

+296
-293
lines changed

lua/bars/highlights.lua

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,64 @@ highlights.groups = {
735735
end
736736
},
737737

738+
default = {
739+
value = function ()
740+
---|fS
741+
742+
---@type integer, integer, integer
743+
local R, G, B = highlights.num_to_rgb(
744+
highlights.get_attr({ "@comment", "Comment" }, "fg") or
745+
highlights.theme_value(
746+
tonumber("7C7F93", 16),
747+
tonumber("9399B2", 16)
748+
)
749+
);
750+
751+
---@type integer, integer, integer
752+
local tR, tG, tB = highlights.num_to_rgb(
753+
highlights.get_attr({ "LineNr", "Normal" }, "bg") or
754+
highlights.theme_value(
755+
tonumber("CDD6F4", 16),
756+
tonumber("1E1E2E", 16)
757+
)
758+
);
759+
760+
local COLORS = {
761+
{
762+
group = "BarsNoMode",
763+
value = {
764+
bg = highlights.rgb_to_hex(R, G, B),
765+
fg = highlights.rgb_to_hex(
766+
highlights.get_nfg(highlights.rgb_to_lumen(R, G, B) / 255)
767+
)
768+
}
769+
}
770+
};
771+
local MAX = 10;
772+
773+
for i = 0, MAX - 1 do
774+
---@type integer, integer, integer
775+
local mR, mG, mB = highlights.mix(
776+
tR, tG, tB,
777+
R, G, B,
778+
i / (MAX - 1)
779+
);
780+
781+
table.insert(COLORS, {
782+
group = string.format("BarsNoMode%d", i + 1),
783+
value = {
784+
fg = highlights.rgb_to_hex(mR, mG, mB),
785+
bg = highlights.rgb_to_hex(tR, tG, tB)
786+
}
787+
});
788+
end
789+
790+
return COLORS;
791+
792+
---|fE
793+
end
794+
},
795+
738796
normal = {
739797
value = function ()
740798
---|fS
@@ -1053,6 +1111,15 @@ highlights.groups = {
10531111
highlights.get_nfg(highlights.rgb_to_lumen(R, G, B) / 255)
10541112
)
10551113
}
1114+
},
1115+
{
1116+
group = "BarsTab",
1117+
value = {
1118+
bg = highlights.rgb_to_hex(R, G, B),
1119+
fg = highlights.rgb_to_hex(
1120+
highlights.get_nfg(highlights.rgb_to_lumen(R, G, B) / 255)
1121+
)
1122+
}
10561123
}
10571124
};
10581125
local MAX = 10;
@@ -1082,6 +1149,7 @@ highlights.groups = {
10821149

10831150
file_icons = {
10841151
value = function ()
1152+
---|fS
10851153
local BASE = {
10861154
{ highlights.num_to_rgb(
10871155
highlights.get_attr({ "Color1", "@markup.heading.1.markdown" }, "fg") or
@@ -1169,8 +1237,82 @@ highlights.groups = {
11691237
end
11701238

11711239
return COLORS;
1240+
1241+
---|fE
11721242
end
1173-
}
1243+
},
1244+
1245+
tabline_nav = {
1246+
value = function ()
1247+
---|fS
1248+
1249+
---@type number, number, number
1250+
local bR, bG, bB = highlights.num_to_rgb(
1251+
highlights.get_attr({ "Normal" }, "bg") or
1252+
highlights.theme_value(
1253+
tonumber("CDD6F4", 16),
1254+
tonumber("1E1E2E", 16)
1255+
)
1256+
);
1257+
1258+
---@type number, number, number
1259+
local fR, fG, fB = highlights.num_to_rgb(
1260+
highlights.get_attr({ "Normal" }, "fg") or
1261+
highlights.theme_value(
1262+
tonumber("1E1E2E", 16),
1263+
tonumber("CDD6F4", 16)
1264+
)
1265+
);
1266+
1267+
---@type number, number, number
1268+
local mR, mG, mB = highlights.mix(
1269+
bR, bG, bB,
1270+
fR, fG, fB,
1271+
0.15
1272+
);
1273+
1274+
---@type integer, integer, integer
1275+
local lR, lG, lB = highlights.num_to_rgb(
1276+
highlights.get_attr({ "Color1", "@markup.heading.1.markdown" }, "fg") or
1277+
highlights.theme_value(
1278+
tonumber("D20F39", 16),
1279+
tonumber("F38BA8", 16)
1280+
)
1281+
);
1282+
1283+
return {
1284+
{
1285+
group = "BarsNav",
1286+
value = {
1287+
fg = highlights.rgb_to_hex(mR, mG, mB),
1288+
}
1289+
},
1290+
{
1291+
group = "BarsNavLocked",
1292+
value = {
1293+
fg = highlights.rgb_to_hex(lR, lG, lB),
1294+
}
1295+
},
1296+
{
1297+
group = "BarsNavOverflow",
1298+
value = {
1299+
fg = highlights.rgb_to_hex(mR, mG, mB),
1300+
}
1301+
},
1302+
{
1303+
group = "BarsInactive",
1304+
value = {
1305+
bg = highlights.rgb_to_hex(mR, mG, mB),
1306+
fg = highlights.rgb_to_hex(
1307+
highlights.get_nfg(highlights.rgb_to_lumen(mR, mG, mB) / 255)
1308+
)
1309+
}
1310+
},
1311+
};
1312+
1313+
---|fE
1314+
end
1315+
},
11741316
};
11751317

11761318
--- Applies highlight groups.

lua/bars/statuscolumn.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ statuscolumn.config = {
125125
text = "",
126126
hl = function (_, window)
127127
---|fS "Color matching the mode"
128-
if vim.api.nvim_get_current_win() ~= window then
129-
return "Layer2I";
130-
end
131128

132129
local _o = {};
133130
local gr_map = {
@@ -154,12 +151,14 @@ statuscolumn.config = {
154151

155152
---@type string
156153
local mode = vim.api.nvim_get_mode().mode;
154+
local USE = gr_map[mode] or gr_map.default
157155

158-
for g = 1, 7 do
159-
---@type string
160-
local hl = gr_map[mode] or gr_map.default;
156+
if vim.api.nvim_get_current_win() ~= window then
157+
USE = "BarsNoMode%d";
158+
end
161159

162-
table.insert(_o, string.format(hl, g));
160+
for g = 1, 7 do
161+
table.insert(_o, string.format(USE, g));
163162
end
164163

165164
return _o;

0 commit comments

Comments
 (0)