1

Color: Put hex colors under the color.hex key

This commit is contained in:
2024-10-14 20:37:45 +02:00
parent 0a39fe41f9
commit b434994994
8 changed files with 118 additions and 121 deletions

View File

@ -53,15 +53,17 @@ in {
# This module sets its own options # This module sets its own options
# to the values specified in a colorscheme file. # to the values specified in a colorscheme file.
modules.color = { modules.color = {
light = lib.pipe colorKeys [ hex = {
(builtins.map (mkColorAssignment lightDefs)) light = lib.pipe colorKeys [
lib.mergeAttrsList (builtins.map (mkColorAssignment lightDefs))
]; lib.mergeAttrsList
];
dark = lib.pipe colorKeys [ dark = lib.pipe colorKeys [
(builtins.map (mkColorAssignment darkDefs)) (builtins.map (mkColorAssignment darkDefs))
lib.mergeAttrsList lib.mergeAttrsList
]; ];
};
rgb = { rgb = {
light = lib.pipe colorKeys [ light = lib.pipe colorKeys [

View File

@ -29,29 +29,26 @@ with mylib.modules; {
default = "JetBrainsMono Nerd Font Mono"; default = "JetBrainsMono Nerd Font Mono";
}; };
# Internal-only options
keys = mkOption { keys = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
description = "The names of all possible colors"; description = "The names of all possible colors";
default = colorKeys; default = colorKeys;
}; };
light = mkOption { hex = mkOption {
type = types.attrs; type = types.attrs;
description = "Colors belonging to the selected light scheme"; description = "Colors in \"RRGGBB\" hexadecimal format";
};
dark = mkOption {
type = types.attrs;
description = "Colors belonging to the selected dark scheme";
}; };
rgbString = mkOption { rgbString = mkOption {
type = types.attrs; type = types.attrs;
description = "Colors belonging to the selected light scheme in 'RR,GG,BB' format"; description = "Colors in \"RR,GG,BB\" decimal format";
}; };
rgb = mkOption { rgb = mkOption {
type = types.attrs; type = types.attrs;
description = "Colors belonging to the selected light scheme in '[RR GG BB]' format"; description = "Colors in [RR GG BB] decimal format";
}; };
} }

View File

@ -188,11 +188,11 @@ in {
enable = true; enable = true;
settings = { settings = {
options = { options = {
background = "${color.dark.text}"; background = "${color.hex.dark.text}";
overlay = true; overlay = true;
overlay_font = "${color.font}:12"; overlay_font = "${color.font}:12";
overlay_text_color = "${color.dark.text}"; overlay_text_color = "${color.hex.dark.text}";
overlay_background_color = "${color.dark.base}"; overlay_background_color = "${color.hex.dark.base}";
}; };
}; };
}; };
@ -227,12 +227,12 @@ in {
monitor = ""; monitor = "";
dots_center = true; dots_center = true;
fade_on_empty = false; fade_on_empty = false;
font_color = "rgb(${color.dark.base})"; font_color = "rgb(${color.hex.dark.base})";
font_family = "${color.font}"; font_family = "${color.font}";
inner_color = "rgb(${color.dark.lavender})"; inner_color = "rgb(${color.hex.dark.lavender})";
outer_color = "rgb(${color.dark.base})"; outer_color = "rgb(${color.hex.dark.base})";
outline_thickness = 2; outline_thickness = 2;
placeholder_text = "<span foreground='\#\#${color.dark.base}'>Password...</span>"; placeholder_text = "<span foreground='\#\#${color.hex.dark.base}'>Password...</span>";
shadow_passes = 0; shadow_passes = 0;
rounding = 5; rounding = 5;
halign = "center"; halign = "center";
@ -246,7 +246,7 @@ in {
position = "0, 300"; position = "0, 300";
monitor = ""; monitor = "";
text = ''cmd[update:1000] date -I''; text = ''cmd[update:1000] date -I'';
color = "rgba(${color.dark.text}AA)"; color = "rgba(${color.hex.dark.text}AA)";
font_size = 22; font_size = 22;
font_family = "${color.font}"; font_family = "${color.font}";
halign = "center"; halign = "center";
@ -258,7 +258,7 @@ in {
position = "0, 200"; position = "0, 200";
monitor = ""; monitor = "";
text = ''cmd[update:1000] date +"%-H:%M"''; text = ''cmd[update:1000] date +"%-H:%M"'';
color = "rgba(${color.dark.text}AA)"; color = "rgba(${color.hex.dark.text}AA)";
font_size = 95; font_size = 95;
font_family = "${color.font} Extrabold"; font_family = "${color.font} Extrabold";
halign = "center"; halign = "center";
@ -323,23 +323,23 @@ in {
monitor = waybar.monitor; monitor = waybar.monitor;
font = "${color.font} 11"; font = "${color.font} 11";
offset = "10x10"; offset = "10x10";
background = "#${color.light.base}"; background = "#${color.hex.light.base}";
foreground = "#${color.light.text}"; foreground = "#${color.hex.light.text}";
frame_width = 2; frame_width = 2;
corner_radius = 5; corner_radius = 5;
separator_color = "frame"; separator_color = "frame";
}; };
urgency_low = { urgency_low = {
frame_color = "#${color.light.green}"; frame_color = "#${color.hex.light.green}";
}; };
urgency_normal = { urgency_normal = {
frame_color = "#${color.light.green}"; frame_color = "#${color.hex.light.green}";
}; };
urgency_critical = { urgency_critical = {
frame_color = "#${color.light.red}"; frame_color = "#${color.hex.light.red}";
}; };
}; };
}; };
@ -358,8 +358,8 @@ in {
gaps_out = 10; gaps_out = 10;
border_size = 2; border_size = 2;
"col.active_border" = "rgb(${color.dark.lavender})"; "col.active_border" = "rgb(${color.hex.dark.lavender})";
"col.inactive_border" = "rgba(${color.dark.base}AA)"; "col.inactive_border" = "rgba(${color.hex.dark.base}AA)";
}; };
group = { group = {
@ -369,12 +369,12 @@ in {
font_size = 10; font_size = 10;
gradients = false; gradients = false;
"col.active" = "rgb(${color.dark.lavender})"; "col.active" = "rgb(${color.hex.dark.lavender})";
"col.inactive" = "rgba(${color.dark.base}AA)"; "col.inactive" = "rgba(${color.hex.dark.base}AA)";
}; };
"col.border_active" = "rgb(${color.dark.lavender})"; "col.border_active" = "rgb(${color.hex.dark.lavender})";
"col.border_inactive" = "rgba(${color.dark.base}AA)"; "col.border_inactive" = "rgba(${color.hex.dark.base}AA)";
}; };
input = { input = {

View File

@ -46,74 +46,74 @@ in {
# #
# The basic colors # The basic colors
foreground = "#${color.light.text}"; foreground = "#${color.hex.light.text}";
background = "#${color.light.base}"; background = "#${color.hex.light.base}";
selection_foreground = "#${color.light.base}"; selection_foreground = "#${color.hex.light.base}";
selection_background = "#${color.light.rosewater}"; selection_background = "#${color.hex.light.rosewater}";
# Cursor colors # Cursor colors
cursor = "#${color.light.rosewater}"; cursor = "#${color.hex.light.rosewater}";
cursor_text_color = "#${color.light.base}"; cursor_text_color = "#${color.hex.light.base}";
# URL underline color when hovering with mouse # URL underline color when hovering with mouse
url_color = "#${color.light.rosewater}"; url_color = "#${color.hex.light.rosewater}";
# Kitty window border colors # Kitty window border colors
active_border_color = "#${color.light.lavender}"; active_border_color = "#${color.hex.light.lavender}";
inactive_border_color = "#${color.light.overlay0}"; inactive_border_color = "#${color.hex.light.overlay0}";
bell_border_color = "#${color.light.yellow}"; bell_border_color = "#${color.hex.light.yellow}";
# OS Window titlebar colors # OS Window titlebar colors
wayland_titlebar_color = "system"; wayland_titlebar_color = "system";
macos_titlebar_color = "system"; macos_titlebar_color = "system";
# Tab bar colors # Tab bar colors
active_tab_foreground = "#${color.dark.base}"; active_tab_foreground = "#${color.hex.dark.base}";
active_tab_background = "#${color.dark.lavender}"; active_tab_background = "#${color.hex.dark.lavender}";
inactive_tab_foreground = "#${color.dark.text}"; inactive_tab_foreground = "#${color.hex.dark.text}";
inactive_tab_background = "#${color.dark.crust}"; inactive_tab_background = "#${color.hex.dark.crust}";
tab_bar_background = "#${color.light.base}"; tab_bar_background = "#${color.hex.light.base}";
# Color for marks (marked text in the terminal) # Color for marks (marked text in the terminal)
mark1_foreground = "#${color.light.base}"; mark1_foreground = "#${color.hex.light.base}";
mark1_background = "#${color.light.lavender}"; mark1_background = "#${color.hex.light.lavender}";
mark2_foreground = "#${color.light.base}"; mark2_foreground = "#${color.hex.light.base}";
mark2_background = "#${color.light.mauve}"; mark2_background = "#${color.hex.light.mauve}";
mark3_foreground = "#${color.light.base}"; mark3_foreground = "#${color.hex.light.base}";
mark3_background = "#${color.light.sapphire}"; mark3_background = "#${color.hex.light.sapphire}";
# The 16 terminal colors # The 16 terminal colors
# black # black
color0 = "#${color.light.subtext1}"; color0 = "#${color.hex.light.subtext1}";
color8 = "#${color.light.subtext0}"; color8 = "#${color.hex.light.subtext0}";
# red # red
color1 = "#${color.light.red}"; color1 = "#${color.hex.light.red}";
color9 = "#${color.light.red}"; color9 = "#${color.hex.light.red}";
# green # green
color2 = "#${color.light.green}"; color2 = "#${color.hex.light.green}";
color10 = "#${color.light.green}"; color10 = "#${color.hex.light.green}";
# yellow # yellow
color3 = "#${color.light.yellow}"; color3 = "#${color.hex.light.yellow}";
color11 = "#${color.light.yellow}"; color11 = "#${color.hex.light.yellow}";
# blue # blue
color4 = "#${color.light.blue}"; color4 = "#${color.hex.light.blue}";
color12 = "#${color.light.blue}"; color12 = "#${color.hex.light.blue}";
# magenta # magenta
color5 = "#${color.light.pink}"; color5 = "#${color.hex.light.pink}";
color13 = "#${color.light.pink}"; color13 = "#${color.hex.light.pink}";
# cyan # cyan
color6 = "#${color.light.teal}"; color6 = "#${color.hex.light.teal}";
color14 = "#${color.light.teal}"; color14 = "#${color.hex.light.teal}";
# white # white
color7 = "#${color.light.surface2}"; color7 = "#${color.hex.light.surface2}";
color15 = "#${color.light.surface1}"; color15 = "#${color.hex.light.surface1}";
}; };
}; };
}; };

View File

@ -1102,40 +1102,40 @@ in {
bubbles = '' bubbles = ''
{ {
normal = { normal = {
a = { fg = "#${color.dark.base}", bg = "#${color.dark.lavender}", gui = "bold" }, a = { fg = "#${color.hex.dark.base}", bg = "#${color.hex.dark.lavender}", gui = "bold" },
b = { fg = "#${color.dark.text}", bg = "#${color.dark.crust}" }, b = { fg = "#${color.hex.dark.text}", bg = "#${color.hex.dark.crust}" },
c = { fg = "#${color.dark.text}", bg = "NONE" }, c = { fg = "#${color.hex.dark.text}", bg = "NONE" },
}, },
insert = { insert = {
a = { fg = "#${color.dark.base}", bg = "#${color.dark.green}", gui = "bold" }, a = { fg = "#${color.hex.dark.base}", bg = "#${color.hex.dark.green}", gui = "bold" },
b = { fg = "#${color.dark.green}", bg = "#${color.dark.crust}" }, b = { fg = "#${color.hex.dark.green}", bg = "#${color.hex.dark.crust}" },
}, },
visual = { visual = {
a = { fg = "#${color.dark.base}", bg = "#${color.dark.mauve}", gui = "bold" }, a = { fg = "#${color.hex.dark.base}", bg = "#${color.hex.dark.mauve}", gui = "bold" },
b = { fg = "#${color.dark.mauve}", bg = "#${color.dark.crust}" }, b = { fg = "#${color.hex.dark.mauve}", bg = "#${color.hex.dark.crust}" },
}, },
replace = { replace = {
a = { fg = "#${color.dark.base}", bg = "#${color.dark.red}", gui = "bold" }, a = { fg = "#${color.hex.dark.base}", bg = "#${color.hex.dark.red}", gui = "bold" },
b = { fg = "#${color.dark.red}", bg = "#${color.dark.crust}" }, b = { fg = "#${color.hex.dark.red}", bg = "#${color.hex.dark.crust}" },
}, },
-- terminal = { -- terminal = {
-- a = { fg = "#${color.dark.base}", bg = "#${color.dark.green}", gui = "bold" }, -- a = { fg = "#${color.hex.dark.base}", bg = "#${color.hex.dark.green}", gui = "bold" },
-- b = { fg = "#${color.dark.green}", bg = "#${color.dark.crust}" }, -- b = { fg = "#${color.hex.dark.green}", bg = "#${color.hex.dark.crust}" },
-- }, -- },
command = { command = {
a = { fg = "#${color.dark.base}", bg = "#${color.dark.peach}", gui = "bold" }, a = { fg = "#${color.hex.dark.base}", bg = "#${color.hex.dark.peach}", gui = "bold" },
b = { fg = "#${color.dark.peach}", bg = "#${color.dark.crust}" }, b = { fg = "#${color.hex.dark.peach}", bg = "#${color.hex.dark.crust}" },
}, },
inactive = { inactive = {
a = { fg = "#${color.dark.text}", bg = "#${color.dark.base}" }, a = { fg = "#${color.hex.dark.text}", bg = "#${color.hex.dark.base}" },
b = { fg = "#${color.dark.text}", bg = "#${color.dark.base}" }, b = { fg = "#${color.hex.dark.text}", bg = "#${color.hex.dark.base}" },
c = { fg = "#${color.dark.text}", bg = "NONE" }, c = { fg = "#${color.hex.dark.text}", bg = "NONE" },
}, },
} }
''; '';
@ -1567,17 +1567,17 @@ in {
opts = { opts = {
line.__raw = '' line.__raw = ''
function(line) function(line)
local base = { fg = "#${color.dark.base}", bg = "#${color.dark.base}" } local base = { fg = "#${color.hex.dark.base}", bg = "#${color.hex.dark.base}" }
local crust = { fg = "#${color.dark.crust}", bg = "#${color.dark.crust}" } local crust = { fg = "#${color.hex.dark.crust}", bg = "#${color.hex.dark.crust}" }
local text = { fg = "#${color.dark.text}", bg = "#${color.dark.crust}" } local text = { fg = "#${color.hex.dark.text}", bg = "#${color.hex.dark.crust}" }
local lavender = { fg = "#${color.dark.lavender}", bg = "#${color.dark.lavender}" } local lavender = { fg = "#${color.hex.dark.lavender}", bg = "#${color.hex.dark.lavender}" }
local numtabs = vim.call("tabpagenr", "$") local numtabs = vim.call("tabpagenr", "$")
return { return {
-- Head -- Head
{ {
{ " NEOVIM ", hl = { fg = "#${color.dark.base}", bg = "#${color.dark.lavender}", style = "bold" } }, { " NEOVIM ", hl = { fg = "#${color.hex.dark.base}", bg = "#${color.hex.dark.lavender}", style = "bold" } },
-- The separator gets a foreground and background fill (each have fg + bg). -- The separator gets a foreground and background fill (each have fg + bg).
-- line.sep("", lavender, lavender), -- line.sep("", lavender, lavender),
@ -1586,7 +1586,7 @@ in {
-- Tabs -- Tabs
line.tabs().foreach(function(tab) line.tabs().foreach(function(tab)
-- Switch out the start separator instead of the ending one because the last separator is different -- Switch out the start separator instead of the ending one because the last separator is different
local hl = tab.is_current() and { fg = "#${color.dark.lavender}", bg = "#${color.dark.crust}", style = "bold" } or text local hl = tab.is_current() and { fg = "#${color.hex.dark.lavender}", bg = "#${color.hex.dark.crust}", style = "bold" } or text
local sep_start = tab.number() == 1 and "" or "" local sep_start = tab.number() == 1 and "" or ""
local sep_end = tab.number() == numtabs and "" or "" local sep_end = tab.number() == numtabs and "" or ""

View File

@ -39,9 +39,9 @@ in {
in { in {
"*" = { "*" = {
bg = mkLiteral "rgba(${color.rgbString.light.base}, 0.3)"; bg = mkLiteral "rgba(${color.rgbString.light.base}, 0.3)";
hl = mkLiteral "#${color.dark.lavender}"; hl = mkLiteral "#${color.hex.dark.lavender}";
hl-pink = mkLiteral "#${color.dark.pink}"; hl-pink = mkLiteral "#${color.hex.dark.pink}";
text = mkLiteral "#${color.dark.base}"; text = mkLiteral "#${color.hex.dark.base}";
trans = mkLiteral "rgba(0, 0, 0, 0)"; trans = mkLiteral "rgba(0, 0, 0, 0)";
}; };

View File

@ -85,7 +85,7 @@ in {
style = '' style = ''
/*Order is Top-Right-Bottom-Left for combined properties*/ /*Order is Top-Right-Bottom-Left for combined properties*/
* { * {
color: #${color.dark.base}; color: #${color.hex.dark.base};
font-family: ${color.font}; font-family: ${color.font};
font-weight: bold; font-weight: bold;
} }
@ -94,25 +94,23 @@ in {
border-style: solid; border-style: solid;
border-width: 2px; border-width: 2px;
border-radius: 6px; border-radius: 6px;
border-color: #${color.dark.lavender}; border-color: #${color.hex.dark.lavender};
/*Can't use color.light.base here because waybar doesn't support rrggbbaa :(*/
background-color: rgba(${color.rgbString.light.base}, 0.3); background-color: rgba(${color.rgbString.light.base}, 0.3);
} }
/*Colors*/ /*Colors*/
#custom-launcher {background-color: #${color.dark.lavender};} #custom-launcher {background-color: #${color.hex.dark.lavender};}
#user {background-color: #${color.dark.pink};} #user {background-color: #${color.hex.dark.pink};}
#window {background-color: #${color.dark.mauve};} #window {background-color: #${color.hex.dark.mauve};}
#workspaces button {background-color: #${color.dark.lavender};} #workspaces button {background-color: #${color.hex.dark.lavender};}
#workspaces button.active {background-color: #${color.dark.pink};} #workspaces button.active {background-color: #${color.hex.dark.pink};}
#pulseaudio {background-color: #${color.dark.maroon};} #pulseaudio {background-color: #${color.hex.dark.maroon};}
#network {background-color: #${color.dark.peach};} #network {background-color: #${color.hex.dark.peach};}
#cpu {background-color: #${color.dark.yellow};} #cpu {background-color: #${color.hex.dark.yellow};}
#memory {background-color: #${color.dark.green};} #memory {background-color: #${color.hex.dark.green};}
#temperature {background-color: #${color.dark.teal};} #temperature {background-color: #${color.hex.dark.teal};}
#clock {background-color: #${color.dark.sky};} #clock {background-color: #${color.hex.dark.sky};}
#tray {background-color: #${color.dark.lavender};} #tray {background-color: #${color.hex.dark.lavender};}
/*Square Widgets*/ /*Square Widgets*/

View File

@ -25,20 +25,20 @@ in {
window-title-home-tilde = statusbar-home-tilde; window-title-home-tilde = statusbar-home-tilde;
# Colorscheme # Colorscheme
default-bg = "#${color.light.base}"; default-bg = "#${color.hex.light.base}";
default-fg = "#${color.light.text}"; default-fg = "#${color.hex.light.text}";
highlight-color = "rgba(${color.rgbString.dark.lavender}, 0.5)"; highlight-color = "rgba(${color.rgbString.dark.lavender}, 0.5)";
highlight-fg = "rgba(${color.rgbString.dark.green}, 0.5)"; highlight-fg = "rgba(${color.rgbString.dark.green}, 0.5)";
highlight-active-color = "rgba(${color.rgbString.dark.pink}, 0.5)"; highlight-active-color = "rgba(${color.rgbString.dark.pink}, 0.5)";
statusbar-bg = "#${color.dark.lavender}"; statusbar-bg = "#${color.hex.dark.lavender}";
statusbar-fg = default-fg; statusbar-fg = default-fg;
inputbar-bg = statusbar-bg; inputbar-bg = statusbar-bg;
inputbar-fg = statusbar-fg; inputbar-fg = statusbar-fg;
completion-bg = "#${color.light.surface0}"; completion-bg = "#${color.hex.light.surface0}";
completion-fg = default-fg; completion-fg = default-fg;
completion-highlight-bg = statusbar-bg; completion-highlight-bg = statusbar-bg;
completion-highlight-fg = completion-fg; completion-highlight-fg = completion-fg;
@ -48,9 +48,9 @@ in {
notification-bg = completion-bg; notification-bg = completion-bg;
notification-fg = default-fg; notification-fg = default-fg;
notification-warning-bg = notification-bg; notification-warning-bg = notification-bg;
notification-warning-fg = "#${color.light.peach}"; notification-warning-fg = "#${color.hex.light.peach}";
notification-error-bg = notification-bg; notification-error-bg = notification-bg;
notification-error-fg = "#${color.light.red}"; notification-error-fg = "#${color.hex.light.red}";
recolor-lightcolor = default-bg; recolor-lightcolor = default-bg;
recolor-darkcolor = default-fg; recolor-darkcolor = default-fg;