Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/molnarmark/colorize
🎨 Simple lightweight package to colorize your terminal output
https://github.com/molnarmark/colorize
nim nim-lang nim-language terminal-colors
Last synced: 19 days ago
JSON representation
🎨 Simple lightweight package to colorize your terminal output
- Host: GitHub
- URL: https://github.com/molnarmark/colorize
- Owner: molnarmark
- License: mit
- Created: 2017-03-28T10:00:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-18T15:49:06.000Z (almost 7 years ago)
- Last Synced: 2025-01-12T00:27:40.638Z (24 days ago)
- Topics: nim, nim-lang, nim-language, terminal-colors
- Language: Nim
- Homepage:
- Size: 3.91 KB
- Stars: 33
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Colorize ##
Colorize is a lightweight and simple terminal coloring library. It makes it easy to make your terminal outputs beautiful.
#### Procs ####
Available procs for `foreground` coloring:
```nim
proc fgRed*(s: string): string
proc fgBlack*(s: string): string
proc fgGreen*(s: string): string
proc fgYellow*(s: string): string
proc fgBlue*(s: string): string
proc fgMagenta*(s: string): string
proc fgCyan*(s: string): string
proc fgLightGray*(s: string): string
proc fgDarkGray*(s: string): string
proc fgLightRed*(s: string): string
proc fgLightGreen*(s: string): string
proc fgLightYellow*(s: string): string
proc fgLightBlue*(s: string): string
proc fgLightMagenta*(s: string): string
proc fgLightCyan*(s: string): string
proc fgWhite*(s: string): string
```
Available procs for `background` coloring:
```nim
proc bgBlack*(s: string): string
proc bgRed*(s: string): string
proc bgGreen*(s: string): string
proc bgYellow*(s: string): string
proc bgBlue*(s: string): string
proc bgMagenta*(s: string): string
proc bgCyan*(s: string): string
proc bgLightGray*(s: string): string
proc bgDarkGray*(s: string): string
proc bgLightRed*(s: string): string
proc bgLightGreen*(s: string): string
proc bgLightYellow*(s: string): string
proc bgLightBlue*(s: string): string
proc bgLightMagenta*(s: string): string
proc bgLightCyan*(s: string): string
proc bgWhite*(s: string): string
```
Available procs for `formatting`:
```nim
proc bold*(s: string): string
proc underline*(s: string): string
proc hidden*(s: string): string
proc invert*(s: string): string
```
#### Usage ####
```nim
echo "Hello, I am a blue text.".fgBlue
echo "Hello, I am now also bold!".bold.fgBlue
```#### Developer ####
- Mark Molnar
#### License ####
[MIT](https://opensource.org/licenses/mit-license.php)