Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 17 days ago
JSON representation

🌈 A terminal string colorizer for the V language.

Awesome Lists containing this project

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
- white

Available styles:
- bold
- dim
- underline
- blink
- reverse
- hidden