color

package
v0.0.0-...-0871eb3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(c Col, str string) string

Add is string with color

Example

----------------------------------------------------------------------------- Test -----------------------------------------------------------------------------

package main

import (
	"fmt"

	c "github.com/hiromaily/golibs/color"
)

func main() {
	fmt.Println(c.Add(c.Blue, "This is Blue"))
	// Output
	// This is Blue
}
Output:

func Addf

func Addf(c Col, format string, a ...interface{}) string

Addf is string with color

Example
package main

import (
	"fmt"

	c "github.com/hiromaily/golibs/color"
)

func main() {
	str := c.Addf(c.Yellow, "This is %s", "Yellow")
	fmt.Println(str)
	// Output
	// This is Yellow
}
Output:

func Check

func Check()

Check is for debug

Types

type Col

type Col string

Col is color string

var (
	Reset       Col = "\x1B[0m"
	Red         Col = "\x1B[38;5;1m"
	Orange      Col = "\x1B[38;5;9m"
	DeepPink    Col = "\x1B[38;5;5m"
	Pink        Col = "\x1B[38;5;13m"
	Yellow      Col = "\x1B[38;5;3m"
	Green       Col = "\x1B[38;5;2m"
	SpringGreen Col = "\x1B[38;5;10m"
	Blue        Col = "\x1B[38;5;4m"
	DeepSkyBlue Col = "\x1B[38;5;6m"
	SkyBlue     Col = "\x1B[38;5;14m"
	Grey        Col = "\x1B[38;5;8m"
	Black       Col = "\x1B[38;5;232m"
	White       Col = "\x1B[38;5;15m"
)

https://misc.flogisoft.com/bash/tip_colors_and_formatting http://jafrog.com/2013/11/23/colors-in-terminal.html

Jump to

Keyboard shortcuts

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