-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolor_module
103 lines (88 loc) · 4.32 KB
/
color_module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
############################################# LICENCE ##############################################
# Copyright (C) 2018, Ivan Balevic
# This file is part of the "Bash Modules" project, a collection
# of Bash scripts that provides additional functionality.
#
# "Bash Modules" is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# "Bash Modules" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with "Bash Modules". If not, see <http://www.gnu.org/licenses/>.
########################################### DESCRIPTION ############################################
# This module contains global variables for 8 basic foreground and background colors as well
# as global variables for BOLD and NO_COLOR modifiers that affect the color presentation.
# For regexes and functions that work with color escape sequences, check the "ANSI_escape_module".
######################################## AVAILABLE GLOBALS #########################################
# Printing style:
#
# NO_COLOR -> Escape sequence that makes terminal print later outputs in default colors/style.
# BOLD -> Escape sequence that makes terminal print later outputs in bold style.
# Backgound colors:
#
# BLACK_BG -> Escape sequence that makes terminal print later outputs with black background.
# RED_BG -> Escape sequence that makes terminal print later outputs with red background.
# GREEN_BG -> Escape sequence that makes terminal print later outputs with green background.
# YELLOW_BG -> Escape sequence that makes terminal print later outputs with yellow background.
# BLUE_BG -> Escape sequence that makes terminal print later outputs with blue background.
# MAGENTA_BG -> Escape sequence that makes terminal print later outputs with magenta background.
# CYAN_BG -> Escape sequence that makes terminal print later outputs with cyan background.
# WHITE_BG -> Escape sequence that makes terminal print later outputs with white background.
# Foreground colors:
#
# BLACK_FG -> Escape sequence that makes terminal print later outputs with black foreground.
# RED_FG -> Escape sequence that makes terminal print later outputs with red foreground.
# GREEN_FG -> Escape sequence that makes terminal print later outputs with green foreground.
# YELLOW_FG -> Escape sequence that makes terminal print later outputs with yellow foreground.
# BLUE_FG -> Escape sequence that makes terminal print later outputs with blue foreground.
# MAGENTA_FG -> Escape sequence that makes terminal print later outputs with magenta foreground.
# CYAN_FG -> Escape sequence that makes terminal print later outputs with cyan foreground.
# WHITE_FG -> Escape sequence that makes terminal print later outputs with white foreground.
# Foreground colors with BOLD escape sequence at the beginning:
#
# B_BLACK_FG -> Bold black foreground.
# B_RED_FG -> Bold red foreground.
# B_GREEN_FG -> Bold green foreground.
# B_YELLOW_FG -> Bold yellow foreground.
# B_BLUE_FG -> Bold blue foreground.
# B_MAGENTA_FG -> Bold magenta foreground.
# B_CYAN_FG -> Bold cyan foreground.
# B_WHITE_FG -> Bold white foreground.
############################################# GLOBALS ##############################################
# Printing style
NO_COLOR="[0m"
BOLD="[1m"
# Background colors
BLACK_BG="[40m"
RED_BG="[41m"
GREEN_BG="[42m"
YELLOW_BG="[43m"
BLUE_BG="[44m"
MAGENTA_BG="[45m"
CYAN_BG="[46m"
WHITE_BG="[47m"
# Foreground colors
BLACK_FG="[30m"
RED_FG="[31m"
GREEN_FG="[32m"
YELLOW_FG="[33m"
BLUE_FG="[34m"
MAGENTA_FG="[35m"
CYAN_FG="[36m"
WHITE_FG="[37m"
# Bold foreground colors
B_BLACK_FG="[1;30m"
B_RED_FG="[1;31m"
B_GREEN_FG="[1;32m"
B_YELLOW_FG="[1;33m"
B_BLUE_FG="[1;34m"
B_MAGENTA_FG="[1;35m"
B_CYAN_FG="[1;36m"
B_WHITE_FG="[1;37m"