add hyprland windowrule and tagging functionality for opacity

This commit is contained in:
KoenDR06 2026-03-23 18:37:21 +01:00
parent 63c10fdae6
commit 06520092e8
3 changed files with 29 additions and 3 deletions

View file

@ -1,11 +1,28 @@
{inputs, ...}: let
inherit (inputs.nixpkgs.lib) toHexString concatStrings strings;
inherit (inputs.nixpkgs.lib) toHexString concatStrings strings toLower;
inherit (strings) fixedWidthString;
padHex = n: fixedWidthString 2 "0" (toHexString n);
in {
padHexLower = n: fixedWidthString 2 "0" (toLower (toHexString n));
toHex = color: concatStrings ["#" (padHex color.red) (padHex color.green) (padHex color.blue)];
toHexNoHash = color: concatStrings [(padHex color.red) (padHex color.green) (padHex color.blue)];
toRGB = color: concatStrings ["rgb(" (toString color.red) "," (toString color.green) "," (toString color.blue) ")"];
toRGB = color: concatStrings ["rgb(" (toHexNoHash color) ")"];
toRGBHex = color: concatStrings ["rgb(" (padHexLower color.red) (padHexLower color.green) (padHexLower color.blue) ")"];
toRGBA = color: a: concatStrings ["rgba(" (toString color.red) "," (toString color.green) "," (toString color.blue) "," (toString a) ")"];
in {
# 0xrrggbb
toHex = toHex;
# rrggbb
toHexNoHash = toHexNoHash;
# rgb(red,green,blue)
toRGB = toRGB;
# rgb(rrggbb)
toRGBHex = toRGBHex;
# rgb(red,green,blue,opac[0-1])
toRGBA = toRGBA;
}