From 48bdd665bd81a89e75f4b8a99fb54a3b13b2a756 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Sun, 2 May 2021 19:46:41 -0700 Subject: [PATCH] fix hex parsing --- home-manager/modules/colors.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-manager/modules/colors.nix b/home-manager/modules/colors.nix index 18d7a65..d67b5ac 100644 --- a/home-manager/modules/colors.nix +++ b/home-manager/modules/colors.nix @@ -7,7 +7,7 @@ let pow = n: i: if i == 1 then n else if i == 0 then 1 else n * pow n (i - 1); alf = [ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f" ]; - fil = c: lib.imap0 (n: x: if (lib.toLower x) == c then n else null) alf; + fil = c: lib.imap0 (n: x: if (lib.toLower x) == (lib.toLower c) then n else null) alf; fin = c: builtins.elemAt (builtins.filter (x: x != null) (fil c)) 0; add = l: lib.foldr ({ n, x }: c: (x * (pow 16 n)) + c) 0 (lib.imap0 (n: x: { inherit n x; }) l); calc = s: add (builtins.map fin (builtins.filter (x: builtins.isString x && builtins.stringLength x == 1) (builtins.split "" s)));