From 244c188deb9efaab154cfd3c29a35e21f2b149d4 Mon Sep 17 00:00:00 2001 From: yage Date: Tue, 16 Aug 2022 23:29:10 -0600 Subject: [PATCH] v2.5.2 ===================================================================== --- Changes ------------------------------ - added __GET_RANDOM_COLOR for funsies --- zsh/utils/colors.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/zsh/utils/colors.zsh b/zsh/utils/colors.zsh index eb1ce2e..72b9d27 100644 --- a/zsh/utils/colors.zsh +++ b/zsh/utils/colors.zsh @@ -23,3 +23,22 @@ __WHITE='\033[1;37m' __LIGHT_GRAY='\033[0;37m' __COLOR_RESET='\033[0m' + +__GET_RANDOM_COLOR() { + local COLORS=( + $__RED + $__LIGHT_RED + $__GREEN + $__LIGHT_GREEN + $__ORANGE + $__YELLOW + $__BLUE + $__DARK_BLUE + $__PURPLE + $__DARK_PURPLE + $__CYAN + $__DARK_CYAN + $__WHITE + ) + print "$__COLOR_RESET${COLORS[$(shuf -i 1-${#COLORS[@]} -n 1)]}" +}