add conversion functions to catppuccin module

This commit is contained in:
KoenDR06 2025-12-24 17:57:24 +01:00
parent 7f5c5b718f
commit 82a11ef821
10 changed files with 663 additions and 391 deletions

8
overlays/catppuccin.nix Normal file
View file

@ -0,0 +1,8 @@
{inputs, ...}: let
inherit (inputs.nixpkgs.lib) toHexString concatStrings;
in {
toHex = color: concatStrings ["#" (toHexString color.red) (toHexString color.green) (toHexString color.blue)];
toHexNoHash = color: concatStrings [(toHexString color.red) (toHexString color.green) (toHexString color.blue)];
toRGB = color: concatStrings ["rgb(" (toString color.red) "," (toString color.green) "," (toString color.blue) ")"];
toRGBA = color: a: concatStrings ["rgba(" (toString color.red) "," (toString color.green) "," (toString color.blue) "," (toString a) ")"];
}