Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xr09/rainbow.sh
Simple colors for your bash scripts
https://github.com/xr09/rainbow.sh
colors shell
Last synced: 13 days ago
JSON representation
Simple colors for your bash scripts
- Host: GitHub
- URL: https://github.com/xr09/rainbow.sh
- Owner: xr09
- License: mit
- Created: 2013-09-05T14:02:37.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-08-24T06:58:02.000Z (about 2 years ago)
- Last Synced: 2024-08-01T19:54:48.168Z (3 months ago)
- Topics: colors, shell
- Language: Shell
- Homepage: http://xr09.github.io/rainbow.sh/
- Size: 31.3 KB
- Stars: 50
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rainbow.sh
==========Colors for your scripts, the easy way.
##Usage
Just import rainbow.sh and start using the available functions in your scripts.
Remember you need to save the output of the desired color function to a variable and print that later, or if you wish to print the whole text in one color just use `echogreen "my green text"`.
~~~~bash
source rainbow.shvargreen=$(echogreen "Grass is green")
varred=$(echored "Roses are red")varblue=$(echoblue "Violets are blue")
varyellow=$(echoyellow "Daisys are yellow")varpurple=$(echopurple "Lavenders are purple")
varcyan=$(echocyan "The water is cyan")echo "$vargreen ..Crickets are noisy.. $varred"
echo "$varblue ..Frogs jump.. $varyellow"
echo "$varpurple ..Dogs run.. $varcyan"
~~~~## How does it look?
### Light palette (default)
![Light palette](light.png)
### Dark palette (see tip below)
![Dark palette](dark.png)
## Tips
* Don't forget to quote parameteres, `echogreen one big apple tree` will only output `one`, you should use `echogreen "one big apple tree"` to get the full output.
* If you wish a darker color palette just redefine `__RAINBOWPALETTE` to `0` like this: `__RAINBOWPALETTE="0"`