Style : Add forceWhiteText.

This commit is contained in:
Dmitry Voronin 2024-05-06 14:08:50 +03:00 committed by Dmitry Voronin
parent c5b3675d75
commit 366c0738bd
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
3 changed files with 14 additions and 12 deletions

View file

@ -48,7 +48,6 @@
font = {
step = 1;
dpi = true;
forceWhite = false;
};
};

View file

@ -1,11 +1,17 @@
{ config, ... }: {
{ config, ... }: let
forceWhiteText = false;
in {
color = {
bg = {
dark = config.lib.stylix.colors.base00;
light = config.lib.stylix.colors.base07;
regular = config.lib.stylix.colors.base01;
};
fg = {
fg = if forceWhiteText then {
dark = "ffffff";
light = "ffffff";
regular = "ffffff";
} else {
dark = config.lib.stylix.colors.base04;
light = config.lib.stylix.colors.base06;
regular = config.lib.stylix.colors.base05;
@ -37,9 +43,10 @@
bg-b = config.lib.stylix.colors.base00-rgb-b;
bg-g = config.lib.stylix.colors.base00-rgb-g;
bg-r = config.lib.stylix.colors.base00-rgb-r;
fg-b = config.lib.stylix.colors.base06-rgb-b;
fg-g = config.lib.stylix.colors.base06-rgb-g;
fg-r = config.lib.stylix.colors.base06-rgb-r;
fg-b = if forceWhiteText then 255 else config.lib.stylix.colors.base06-rgb-b;
fg-g = if forceWhiteText then 255 else config.lib.stylix.colors.base06-rgb-g;
fg-r = if forceWhiteText then 255 else config.lib.stylix.colors.base06-rgb-r;
};
font = {

View file

@ -1,9 +1,4 @@
{ style, setting, util, ... }: let
foreground = if setting.foot.font.forceWhite then ''
foreground=ffffff
'' else ''
foreground=${style.color.fg.light}
'';
dpiaware = if setting.foot.font.dpi then "yes" else "no";
in {
config = util.trimTabs ''
@ -17,5 +12,6 @@ in {
[colors]
alpha=${toString(style.opacity.terminal)}
background=${style.color.bg.dark}
'' + foreground;
foreground=${style.color.fg.light}
'';
}