Skip to content

Instantly share code, notes, and snippets.

@WestleyK
Created August 15, 2018 01:19
Show Gist options
  • Save WestleyK/dc71766b3ce28bb31be54b9ab7709082 to your computer and use it in GitHub Desktop.
Save WestleyK/dc71766b3ce28bb31be54b9ab7709082 to your computer and use it in GitHub Desktop.
printf color output
#!/bin/bash
#
# Created by: Westley K
# Date: Aug 14, 2018
#
# run this in your terminal, and
# you will get nice colors and effects!
#
printf "Colors:\n"
printf "\033[0;30mHello World! black\033[0m\n"
printf "\033[0;31mHello World! red\033[0m\n"
printf "\033[0;32mHello World! green\033[0m\n"
printf "\033[0;33mHello World! yellow\033[0m\n"
printf "\033[0;34mHello World! blue\033[0m\n"
printf "\033[0;35mHello World! pink\033[0m\n"
printf "\033[0;36mHello World! teal\033[0m\n"
printf "\033[0;37mHello World! white\033[0m\n"
printf "\nBold:\n"
printf "\033[30;1mHello World! grey\033[0m\n"
printf "\033[31;1mHello World! orange\033[0m\n"
printf "\033[32;1mHello World! green\033[0m\n"
printf "\033[33;1mHello World! yellow\033[0m\n"
printf "\033[34;1mHello World! blue\033[0m\n"
printf "\033[35;1mHello World! pink\033[0m\n"
printf "\033[36;1mHello World! teal\033[0m\n"
printf "\033[37;1mHello World! white\033[0m\n"
printf "\nEffects:\n\n"
printf "Black text effects:\n"
printf "\033[30;2mHello World!\033[0m\n"
printf "\033[30;3mHello World!\033[0m\n"
printf "\033[30;4mHello World!\033[0m\n"
printf "\033[30;5mHello World! blink\033[0m\n"
printf "\033[30;6mHello World!\033[0m\n"
printf "\033[30;7mHello World!\033[0m\n"
printf "\033[30;8mHello World!\033[0m\n"
printf "\nRed text effects:\n"
printf "\033[31;2mHello World! faint\033[0m\n"
printf "\033[31;3mHello World! normal\033[0m\n"
printf "\033[31;4mHello World! underline\033[0m\n"
printf "\033[31;5mHello World! blink\033[0m\n"
printf "\033[31;6mHello World! normal, I think\033[0m\n"
printf "\033[31;7mHello World! negative text\033[0m\n"
printf "\nGreen text effects:\n"
printf "\033[32;2mHello World! faint\033[0m\n"
printf "\033[32;3mHello World! normal\033[0m\n"
printf "\033[32;4mHello World! underline\033[0m\n"
printf "\033[32;5mHello World! blink\033[0m\n"
printf "\033[32;6mHello World! normal, I think\033[0m\n"
printf "\033[32;7mHello World! negative text\033[0m\n"
printf "\nYellow text effects:\n"
printf "\033[33;2mHello World! faint\033[0m\n"
printf "\033[33;3mHello World! normal\033[0m\n"
printf "\033[33;4mHello World! underline\033[0m\n"
printf "\033[33;5mHello World! blink\033[0m\n"
printf "\033[33;6mHello World! normal, I think\033[0m\n"
printf "\033[33;7mHello World! negative text\033[0m\n"
printf "\nBlue text effects:\n"
printf "\033[34;2mHello World! faint\033[0m\n"
printf "\033[34;3mHello World! normal\033[0m\n"
printf "\033[34;4mHello World! underline\033[0m\n"
printf "\033[34;5mHello World! blink\033[0m\n"
printf "\033[34;6mHello World! normal, I think\033[0m\n"
printf "\033[34;7mHello World! negative text\033[0m\n"
printf "\nPink text effects:\n"
printf "\033[35;2mHello World! faint\033[0m\n"
printf "\033[35;3mHello World! normal\033[0m\n"
printf "\033[35;4mHello World! underline\033[0m\n"
printf "\033[35;5mHello World! blink\033[0m\n"
printf "\033[35;6mHello World! normal, I think\033[0m\n"
printf "\033[35;7mHello World! negative text\033[0m\n"
printf "\nTeal text effects:\n"
printf "\033[36;2mHello World! faint\033[0m\n"
printf "\033[36;3mHello World! normal\033[0m\n"
printf "\033[36;4mHello World! underline\033[0m\n"
printf "\033[36;5mHello World! blink\033[0m\n"
printf "\033[36;6mHello World! normal, I think\033[0m\n"
printf "\033[36;7mHello World! negative text\033[0m\n"
printf "\nWhite text effects:\n"
printf "\033[37;2mHello World! faint\033[0m\n"
printf "\033[37;3mHello World! normal\033[0m\n"
printf "\033[37;4mHello World! underline\033[0m\n"
printf "\033[37;5mHello World! blink\033[0m\n"
printf "\033[37;6mHello World! normal, I think\033[0m\n"
printf "\033[37;7mHello World! negative text\033[0m\n"
printf "\n"
#
# End script
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment