Skip to content

Instantly share code, notes, and snippets.

@taiar
Created January 3, 2022 16:18
Show Gist options
  • Save taiar/a89b73b651430eb721331b863ad2afe5 to your computer and use it in GitHub Desktop.
Save taiar/a89b73b651430eb721331b863ad2afe5 to your computer and use it in GitHub Desktop.
ZSH Random color name
#!/usr/bin/env zsh
declare -a colors
colors=(
"red"
"purple"
"yellow"
"blue"
"cyan"
"black"
"green"
)
declare -r colors
echo ${colors[$(( $RANDOM % ${#colors[@]} + 1 ))]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment