coloredPrint

module
v0.0.0-...-77da9dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2021 License: MIT

README

FMC

Library for coloring text in the console.
powered by https://github.com/fatih/color
Features
  • specify tags directly in the formatting string;
  • Support prinft/print/println;

Color:

  • yst Yellow

  • ybt Yellow, Bold

  • rst Red

  • rbt Red, Bold

  • gst Green

  • gbt Green, Bold

  • bst Blue

  • bbt Blue, Bold

  • wst White

  • wbt White, Bold

Color Description:

in hashtag:
  • first char it is Color name(Red,Blue..)
  • second char it is font weight slim\bold
  • first char it is background color transparent (another colors not implemented yet)

Examples:

package main
import "github.com/mallvielfrass/coloredPrint/fmc"
func main() {
colors := [10]string{"yst", "ybt", "rst", "rbt", "gst", "gbt", "bst", "bbt", "wst", "wbt"}
for _, value := range colors {
	fmc.Printf("color: #"+value+value+" %s\n", "test")
}

fmc.Printf("#ybt I#rbt  love#bbt  Go#gbt!\n")
fmc.Printf("#ybt %s#rbt  %s#bbt  %s#gbt%s\n", "I", "love", "Go", "!")
fmc.Print("#ybt lol")
fmc.Printfln("#ybt  %s", "I")
fmc.Println("#bbt Println")
}

Result

Result;

Directories

Path Synopsis
cmd
2t

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL