From 247a8e677b51f053ca89dcf67059e24f85e47391 Mon Sep 17 00:00:00 2001 From: Didn't read the style guide <50516935+lordkekz@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:02:51 +0200 Subject: [PATCH] feat(okular): add more accessibility options (#401) Co-authored-by: Heitor Augusto --- modules/apps/okular.nix | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/modules/apps/okular.nix b/modules/apps/okular.nix index a93fb8fd..bc3e5e43 100644 --- a/modules/apps/okular.nix +++ b/modules/apps/okular.nix @@ -145,9 +145,24 @@ with lib.types; description = "Mode used to change the colors."; default = null; type = nullOr (enum [ + # Inverts colors, including hue "Inverted" + # Change background color (see option below) "Paper" + # Change light and dark colors (see options below) "Recolor" + # Change to black & white colors (see options below) + "BlackWhite" + # Invert lightness but leave hue and saturation + "InvertLightness" + # Like InvertLightness, but slightly more contrast + "InvertLumaSymmetric" + # Like InvertLightness, but much more contrast + "InvertLuma" + # Shift hue of all colors by 120 degrees + "HueShiftPositive" + # Shift hue of all colors by 240 degrees + "HueShiftNegative" ]); }; paperColor = lib.mkOption { @@ -168,6 +183,22 @@ with lib.types; example = "255,255,255"; type = nullOr str; }; + blackWhiteContrast = lib.mkOption { + description = "New contrast strength. Used for the `BlackWhite` mode."; + default = null; + example = 4; + type = nullOr (ints.between 2 6); + }; + blackWhiteThreshold = lib.mkOption { + description = '' + A threshold for deciding between black and white. + Higher values lead to brighter grays. + Used for the `BlackWhite` mode. + ''; + default = null; + example = 127; + type = nullOr (numbers.between 2 253); + }; }; }; @@ -186,7 +217,7 @@ with lib.types; type = nullOr (enum [ "Low" "Normal" - "Agressive" + "Aggressive" "Greedy" ]); }; @@ -236,6 +267,8 @@ with lib.types; "HighlightLinks" = applyIfSet acc.highlightLinks; "RecolorBackground" = applyIfSet acc.changeColors.recolorBackground; "RecolorForeground" = applyIfSet acc.changeColors.recolorForeground; + "BWContrast" = applyIfSet acc.changeColors.blackWhiteContrast; + "BWThreshold" = applyIfSet acc.changeColors.blackWhiteThreshold; }; "Core Performance" = {