Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/etienne-napoleone/chalk
🌈 A terminal string colorizer for the V language.
https://github.com/etienne-napoleone/chalk
colors terminal terminal-colors vlang vlang-library
Last synced: 11 days ago
JSON representation
🌈 A terminal string colorizer for the V language.
- Host: GitHub
- URL: https://github.com/etienne-napoleone/chalk
- Owner: etienne-napoleone
- License: mit
- Created: 2019-10-04T15:01:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-29T20:56:58.000Z (over 2 years ago)
- Last Synced: 2024-10-04T13:18:35.618Z (3 months ago)
- Topics: colors, terminal, terminal-colors, vlang, vlang-library
- Language: V
- Homepage:
- Size: 11.7 KB
- Stars: 22
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-v - chalk - Colorize strings in the terminal. (Libraries / Text processing)
README
> **Warning**
>
> This repo is no longer maintained, please check [Mewzax's fork](https://github.com/Mewzax/chalk)# Chalk
A terminal string colorizer for the [V language](https://vlang.io).
## Installation
With vpm:
```
v install etienne_napoleone.chalk
```## Usage
Chalk offers three functions:
- `chalk.fg(text string, color string)` - To change the foreground color.
- `chalk.bg(text string, color string)` - To change the background color.
- `chalk.style(text string, style string)` - To change the text style.Example:
```v
import chalk# basic usage
println('I am really ' + chalk.fg('happy', 'green'))# you can also nest them
println('I am really ' + chalk.fg(chalk.style('ANGRY', 'bold'), 'red'))
```Available colors:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- default
- light_gray
- dark_gray
- light_red
- light_green
- light_yellow
- light_blue
- light_magenta
- light_cyan
- whiteAvailable styles:
- bold
- dim
- underline
- blink
- reverse
- hidden