2024-02-22 06:34:18 +00:00
|
|
|
{ pkgs, lib }:
|
|
|
|
|
2024-02-23 12:37:06 +00:00
|
|
|
let
|
|
|
|
isBaseX = i: palette:
|
|
|
|
let
|
|
|
|
paletteNames = pkgs.lib.attrNames palette;
|
2024-02-24 13:37:53 +00:00
|
|
|
maxDigitLength = pkgs.lib.lists.length (pkgs.lib.toBaseDigits 10 i);
|
|
|
|
mkBaseAttr = hex: "base${lib.hex.pad maxDigitLength hex}";
|
|
|
|
schemeNames = builtins.map mkBaseAttr (lib.hex.range 0 (i - 1));
|
2024-02-23 12:37:06 +00:00
|
|
|
in
|
2024-02-24 13:37:53 +00:00
|
|
|
(pkgs.lib.count (name: pkgs.lib.elem name schemeNames) paletteNames) == i;
|
2024-02-23 12:37:06 +00:00
|
|
|
in
|
2024-02-22 06:34:18 +00:00
|
|
|
{
|
2024-02-23 06:47:49 +00:00
|
|
|
# TODO: Return a derivation containing all of the template output from the
|
|
|
|
# given schemes.
|
|
|
|
generateOutputFromSchemes = schemes: template:
|
|
|
|
pkgs.runCommand "generate-templates" { } ''
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: Return a Nix object to generate a Tinted Theming color scheme from an
|
|
|
|
# image.
|
|
|
|
generateScheme = image: { };
|
|
|
|
|
2024-02-22 06:34:18 +00:00
|
|
|
# A very naive implementation of checking if a Tinted Theming scheme is a
|
|
|
|
# Base16 scheme.
|
2024-02-23 12:37:06 +00:00
|
|
|
isBase16 = isBaseX 16;
|
2024-02-22 06:34:18 +00:00
|
|
|
|
2024-02-23 12:37:06 +00:00
|
|
|
# Same but with Base24 scheme.
|
|
|
|
isBase24 = isBaseX 24;
|
2024-02-22 06:34:18 +00:00
|
|
|
}
|