Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions docs/gemstones/string_color.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,40 @@ When we download bash scripts that have been written by others in our daily work

## Font color

| **color code** | **describe** |
| **color code** | **description** |
| :---: | :---: |
| 30 | black |
| 31 | red |
| 32 | green |
| 33 | yellow |
| 34 | blue |
| 35 | purple |
| 36 | Dark green |
| 36 | dark green |
| 37 | white |

## Background color of font

| **Background color code** | **describe** |
| **background color code** | **description** |
| :---: | :---: |
| 40 | black |
| 41 | Crimson |
| 41 | crimson |
| 42 | green |
| 43 | yellow |
| 44 | blue |
| 45 | purple |
| 46 | Dark green |
| 46 | dark green |
| 47 | white |

## Display mode

| **code** | **describe** |
| **code** | **description** |
| :---: | :---: |
| 0 |Terminal default settings|
| 1 |Highlight|
| 4 |Underline|
| 5 |Currsor blinks|
| 5 |Cursor blinks|
| 7 |Reverse display|
| 8 | hide |
| 8 |Hide |

## Mode of execution

Expand All @@ -66,23 +66,23 @@ We can write a script to observe the color change.
# Font color cycle
for color1 in {31..37}
do
echo -e "\033[0;${color1};40m---hello! world---\033[0m"
echo -e "\033[0;${color1};40m---hello! Rocky---\033[0m"
done

echo "-------"

# Background color cycle
for color2 in {40..47}
do
echo -e "\033[30;${color2}m---hello! world---\033[0m"
echo -e "\033[30;${color2}m---hello! Rocky---\033[0m"
done

echo "-------"

# Cycle of display mode
for color3 in 0 1 4 5 7 8
do
echo -e "\033[${color3};37;40m---hello! world---\033[0m"
echo -e "\033[${color3};37;40m---hello! Rocky---\033[0m"
done
```

Expand Down