From 78ac78bb1d2160b3601b2656dd2c48857068d0c5 Mon Sep 17 00:00:00 2001 From: Louis Dalibard Date: Mon, 23 Dec 2024 15:28:40 +0100 Subject: [PATCH] feat: add even-darker --- modules/gnome/hm.nix | 2 +- modules/qutebrowser/hm.nix | 2 +- palette-generator/Stylix/Palette.hs | 4 ++++ stylix/palette.nix | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/gnome/hm.nix b/modules/gnome/hm.nix index a2e6ef710..d79b876e6 100644 --- a/modules/gnome/hm.nix +++ b/modules/gnome/hm.nix @@ -37,7 +37,7 @@ in { # settings tile is removed. The value is still used by Epiphany to # request dark mode for websites which support it. color-scheme = - if config.stylix.polarity == "dark" || config.stylix.polarity == "darker" + if config.stylix.polarity == "dark" || config.stylix.polarity == "darker" || config.stylix.polarity == "even-darker" then "prefer-dark" else "default"; diff --git a/modules/qutebrowser/hm.nix b/modules/qutebrowser/hm.nix index fc839c7bf..bfc545623 100644 --- a/modules/qutebrowser/hm.nix +++ b/modules/qutebrowser/hm.nix @@ -248,7 +248,7 @@ in { }; webpage = let - isDark = config.stylix.polarity == "dark" || config.stylix.polarity == "darker"; + isDark = config.stylix.polarity == "dark" || config.stylix.polarity == "darker" || config.stylix.polarity == "even-darker"; in { darkmode.enabled = lib.mkIf isDark (lib.mkDefault true); diff --git a/palette-generator/Stylix/Palette.hs b/palette-generator/Stylix/Palette.hs index 1727af445..535a420f4 100644 --- a/palette-generator/Stylix/Palette.hs +++ b/palette-generator/Stylix/Palette.hs @@ -76,6 +76,7 @@ instance Species (String, Image PixelRGB8) (V.Vector LAB) where "light" -> lightScheme "dark" -> darkScheme "darker" -> darkerScheme + "even-darker" -> evenDarkerScheme _ -> error ("Invalid polarity: " ++ polarity) {- @@ -94,3 +95,6 @@ instance Species (String, Image PixelRGB8) (V.Vector LAB) where darkerScheme = lightnessError (V.fromList [5, 10, 15, 20, 70, 80, 95, 95]) 60 + + evenDarkerScheme + = lightnessError (V.fromList [2, 4, 8, 10, 70, 80, 95, 95]) 60 diff --git a/stylix/palette.nix b/stylix/palette.nix index 0c6f49889..3d7befc69 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -23,7 +23,7 @@ let in { options.stylix = { polarity = lib.mkOption { - type = lib.types.enum [ "either" "light" "dark" "darker" ]; + type = lib.types.enum [ "either" "light" "dark" "darker" "even-darker" ]; default = "either"; description = '' Use this option to force a light or dark theme.