Skip to content

Commit 1b19b08

Browse files
Support more styles like italic, blink and strike
1 parent 8d0e7bb commit 1b19b08

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

β€ŽREADME.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ Please note that [certain colors](https://github.com/PeterDaveHello/ColorEchoFor
3636
### Examples
3737

3838
* echo.Cyan
39+
* echo.ICyan
3940
* echo.ULCyan
41+
* echo.BLCyan
42+
* echo.STCyan
4043
* echo.BoldCyan
4144
* echo.BoldULCyan
4245
* echo.ULBoldCyan
@@ -52,7 +55,10 @@ Please note that [certain colors](https://github.com/PeterDaveHello/ColorEchoFor
5255
## Supported styles
5356

5457
* Bold as `Bold`
58+
* Italic as `I`
5559
* Underline as `UL`
60+
* Blink as `BL`
61+
* Strikethrough as `ST`
5662

5763
## Supported colors
5864

β€Žgenerator.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,24 @@ SH_ECHO
128128
else
129129
code=9
130130
fi
131-
# style like bold, underline
132-
for style in "" "Bold" "UL"; do
131+
# style like bold, italic, underline, blinking, strikethrough
132+
for style in "" "Bold" "I" "UL" "BL" "ST"; do
133133
case "${style}" in
134134
"Bold") styleCode='1;' ;;
135+
"I") styleCode='3;' ;;
135136
"UL") styleCode='4;' ;;
137+
"BL") styleCode='5;' ;;
138+
"ST") styleCode='9;' ;;
136139
""|*) styleCode= ;;
137140
esac
138-
for style2 in "" "Bold" "UL"; do
141+
for style2 in "" "Bold" "I" "UL" "BL" "ST"; do
139142
if [ "${style}" != "${style2}" ]; then
140143
case "${style2}" in
141144
"Bold") finalStyleCode="${styleCode}1;" ;;
145+
"I") finalStyleCode="${styleCode}3;" ;;
142146
"UL") finalStyleCode="${styleCode}4;" ;;
147+
"BL") finalStyleCode="${styleCode}5;" ;;
148+
"ST") finalStyleCode="${styleCode}9;" ;;
143149
""|*) finalStyleCode="${styleCode}" ;;
144150
esac
145151
else

0 commit comments

Comments
Β (0)