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

https://github.com/treasersimplifies/cstr

colorful string printing in your console
https://github.com/treasersimplifies/cstr

color golang logging printing string

Last synced: 2 months ago
JSON representation

colorful string printing in your console

Awesome Lists containing this project

README

        

# Colorful String

Dye your string with color when printing it.

Are you a programmer willing to try something new?

Are you bored with you single-color command line output text(like the following)?

![](./pics/boring.jpg)

Are you looking for decorations for your command line tool?

This package will show you this:

![](./pics/colorful.jpg)

## Example

```shell
$ git clone [email protected]:treasersimplifies/cstr.git
$ cd cstr
$ go test
```

and you will see:

![](./pics/demo.jpg)

## Installation

To install cstr package, you need to install Go first.

Install cstr:

```shell
go get github.com/treasersimplifies/cstr
# or:
go get -u github.com/treasersimplifies/cstr@master
```
Import cstr in your code:

```go
import "github.com/treasersimplifies/cstr"
```

Use in code:

```go

fmt.Println(cstr.Dye("This is a Red string.....", "Red"))
fmt.Println(cstr.DyeColorfully("THIS IS A COLORFUL STRING...........\n", []string{"Red", "Green", "Yellow", "Blue", "Pink", "Skyblue", "White"}))

```