nixos-icons: pad hex color values with leading zeros (#1584)

Closes: https://github.com/nix-community/stylix/issues/1581
Link: https://github.com/nix-community/stylix/pull/1584

Reviewed-by: Daniel Thwaites <danth@danth.me>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Osi 2025-07-04 15:24:00 +02:00 committed by GitHub
parent 3c73dee2db
commit 825d79112f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,7 @@
inherit (oldAttrs) src;
prePatch =
let
inherit (builtins) stringLength;
inherit (config.lib.stylix) colors;
inherit (lib)
@ -46,6 +47,8 @@
(map (max 0))
# convert each to hex string
(map toHexString)
# add leading 0 if necessary
(map (hex: if (stringLength hex < 2) then "0" + hex else hex))
# to one string
concatStrings
];