Last active
July 29, 2021 03:43
-
-
Save glaucomorais/c2fa4a987f2f2375acc2ae3e2a8c9561 to your computer and use it in GitHub Desktop.
Define SGR constants to format bash scripts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
# # | |
# ShellColors v1.0 # | |
# # | |
# Define SGR constants to format bash scripts. # | |
# # | |
# Author: Glauco Morais (https://git.io/JB8nU) # | |
# License: MIT # | |
# # | |
# Copyright (c) 2021 Glauco Morais # | |
# # | |
# Permission is hereby granted, free of charge, to any person obtaining # | |
# a copy of this software and associated documentation files # | |
# (the "Software"), to deal in the Software without restriction, # | |
# including without limitation the rights to use, copy, modify, merge, # | |
# publish, distribute, sublicense, and/or sell copies of the Software, # | |
# and to permit persons to whom the Software is furnished to do so, # | |
# subject to the following conditions: # | |
# # | |
# The above copyright notice and this permission notice shall be # | |
# included in all copies or substantial portions of the Software. # | |
# # | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # | |
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # | |
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # | |
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS # | |
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # | |
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # | |
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # | |
# SOFTWARE. # | |
# # | |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
# Foreground Colors | |
BLACK="\033[30m" | |
RED="\033[31m" | |
GREEN="\033[32m" | |
YELLOW="\033[33m" | |
BLUE="\033[34m" | |
MAGENTA="\033[35m" | |
CYAN="\033[36m" | |
LIGHTGRAY="\033[37m" | |
GRAY="\033[90m" | |
LIGHTRED="\033[91m" | |
LIGHTGREEN="\033[92m" | |
LIGHTYELLOW="\033[93m" | |
LIGHTBLUE="\033[94m" | |
LIGHTMAGENTA="\033[95m" | |
LIGHTCYAN="\033[96m" | |
WHITE="\033[97m" | |
# Background Colors | |
BGBLACK="\033[40m" | |
BGRED="\033[41m" | |
BGGREEN="\033[42m" | |
BGYELLOW="\033[43m" | |
BGBLUE="\033[44m" | |
BGMAGENTA="\033[45m" | |
BGCYAN="\033[46m" | |
BGLIGHTGRAY="\033[47m" | |
BGGRAY="\033[100m" | |
BGLIGHTRED="\033[101m" | |
BGLIGHTGREEN="\033[102m" | |
BGLIGHTYELLOW="\033[103m" | |
BGLIGHTBLUE="\033[104m" | |
BGLIGHTMAGENTA="\033[105m" | |
BGLIGHTCYAN="\033[106m" | |
BGWHITE="\033[107m" | |
# Format | |
BOLD="\033[1m" | |
FAINT="\033[2m" | |
ITALIC="\033[3m" | |
UNDERLINE="\033[4m" | |
# End/Close color/format | |
END="\033[0m" | |
ENDFG="\033[39m" | |
ENDBG="\033[49m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment