-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrgb1.sh
More file actions
executable file
·36 lines (26 loc) · 866 Bytes
/
rgb1.sh
File metadata and controls
executable file
·36 lines (26 loc) · 866 Bytes
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
#!/bin/bash
# RGB bar colors (change as needed)
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
# Reset text color
RESET='\033[0m'
# Get terminal width
TERMINAL_WIDTH=$(tput cols)
# Function to display RGB bar filling the terminal width
display_rgb_bar() {
local color=$1
local bar_width=$2
local num_chars=$((TERMINAL_WIDTH * bar_width / 4)) # Adjust the divisor for different thickness
for ((i = 0; i < num_chars; i++)); do
echo -en "${color}█${RESET}" # Use a thinner block character
done
echo
}
# Display RGB bars
echo "Red:"
display_rgb_bar $RED 3 # Adjust the bar width (currently set to 3 for thinner bars)
echo "Green:"
display_rgb_bar $GREEN 3 # Adjust the bar width (currently set to 3 for thinner bars)
echo "Blue:"
display_rgb_bar $BLUE 3 # Adjust the bar width (currently set to 3 for thinner bars)