mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
bahaghari/lib: reformat and update comments
This commit is contained in:
parent
4834595351
commit
89a9bc32a0
@ -20,6 +20,7 @@ pkgs.lib.makeExtensible
|
|||||||
# a top-level attribute.
|
# a top-level attribute.
|
||||||
tinted-theming = callLibs ./tinted-theming.nix;
|
tinted-theming = callLibs ./tinted-theming.nix;
|
||||||
|
|
||||||
inherit (self.trivial) importYAML toYAML toBaseDigitsWithGlyphs generateGlyphSet;
|
inherit (self.trivial) importYAML toYAML toBaseDigitsWithGlyphs
|
||||||
|
generateGlyphSet;
|
||||||
inherit (self.hex) toHexString isHexString;
|
inherit (self.hex) toHexString isHexString;
|
||||||
})
|
})
|
||||||
|
@ -11,9 +11,11 @@ rec {
|
|||||||
Type: range :: Int -> Int -> [ String ]
|
Type: range :: Int -> Int -> [ String ]
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
range 15 18 => [ "F" "10" "11" ]
|
range 15 18
|
||||||
|
=> [ "F" "10" "11" ]
|
||||||
*/
|
*/
|
||||||
range = first: last: builtins.map (n: toHexString n) (pkgs.lib.lists.range first last);
|
range = first: last:
|
||||||
|
builtins.map (n: toHexString n) (pkgs.lib.lists.range first last);
|
||||||
|
|
||||||
/* Checks if the given hex string is valid or not.
|
/* Checks if the given hex string is valid or not.
|
||||||
|
|
||||||
|
@ -21,10 +21,31 @@ in
|
|||||||
# image.
|
# image.
|
||||||
generateScheme = image: { };
|
generateScheme = image: { };
|
||||||
|
|
||||||
# A very naive implementation of checking if a Tinted Theming scheme is a
|
/* A very naive implementation of checking whether the given palette is a
|
||||||
# Base16 scheme.
|
valid Base16 palette. It simply checks if `base00` to `base0F` is present.
|
||||||
|
|
||||||
|
Type: isBase16 :: Attrs -> Bool
|
||||||
|
|
||||||
|
Example:
|
||||||
|
isBase16 (bahaghariLib.importYAML ./base16.yml).palette
|
||||||
|
=> true
|
||||||
|
|
||||||
|
isBase16 (bahaghariLib.importYAML ./base16-scheme-with-missing-base0F.yml).palette
|
||||||
|
=> false
|
||||||
|
*/
|
||||||
isBase16 = isBaseX 16;
|
isBase16 = isBaseX 16;
|
||||||
|
|
||||||
# Same but with Base24 scheme.
|
/* Similar to `isBase16` but for Base24 schemes. It considers the scheme as
|
||||||
|
valid if `base00` to `base17` from the palette are present.
|
||||||
|
|
||||||
|
Type: isBase24 :: Attrs -> Bool
|
||||||
|
|
||||||
|
Example:
|
||||||
|
isBase24 (bahaghariLib.importYAML ./base24.yml).palette
|
||||||
|
=> true
|
||||||
|
|
||||||
|
isBase24 (bahaghariLib.importYAML ./base24-scheme-with-missing-base0F.yml).palette
|
||||||
|
=> false
|
||||||
|
*/
|
||||||
isBase24 = isBaseX 24;
|
isBase24 = isBaseX 24;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user