colorize

package module
v0.0.0-...-cd242ba Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NoColor                = ""
	DefaultColor           = "white"
	YellowColor            = "yellow"
	GreenColor             = "green"
	GoldenRodColor         = "goldenrod"
	OrangeColor            = "orange"
	TealColor              = "teal"
	CornSilkColor          = "cornsilk"
	DeepPinkColor          = "deeppink"
	RedColor               = "red"
	BlueColor              = "blue"
	LightBlueColor         = "lightblue"
	LightCoralColor        = "lightcoral"
	LightCyanColor         = "lightcyan"
	LavenderColor          = "lavender"
	LightSalmonColor       = "lightsalmon"
	MediumBlueColor        = "mediumblue"
	MistyRoseColor         = "mistyrose"
	SkyBlueColor           = "skyblue"
	LightSkyBlueColor      = "lightskyblue"
	MediumSpringGreenColor = "mediumspringgreen"
	WheatColor             = "wheat"
	YellowGreenColor       = "yellowgreen"
	LightYellowColor       = "lightyellow"
	DarkOrangeColor        = "darkorange"
	LightGreenColor        = "lightgreen"
	DarkMagentaColor       = "darkmagenta"
	CyanColor              = "aqua"
)

Color constant names we can use

Variables

This section is empty.

Functions

func Blue

func Blue(a interface{}, w ...interface{}) string

Blue - return string based on the color given

func ColorWithName

func ColorWithName(color string, a interface{}, w ...interface{}) string

ColorWithName - Find and set the color by name

func Colorize

func Colorize(color string, v interface{}, w ...interface{}) string

Colorize - Add color to the value passed, w size can be 0, 1 or 2

w[0] is the width and w[1] is precision or a float value if present
w[1] is not present then use default colorInfo.floatPrecision
w[2] is the foreground color
w[3] is the background color
w[4] is the attribute of the color

func CornSilk

func CornSilk(a interface{}, w ...interface{}) string

CornSilk - return string based on the color given

func Cyan

func Cyan(a interface{}, w ...interface{}) string

Cyan - return string based on the color given

func DarkMagenta

func DarkMagenta(a interface{}, w ...interface{}) string

DarkMagenta - return string based on the color given

func DarkOrange

func DarkOrange(a interface{}, w ...interface{}) string

DarkOrange - return string based on the color given

func DeepPink

func DeepPink(a interface{}, w ...interface{}) string

DeepPink - return string based on the color given

func DefaultBackgroundColor

func DefaultBackgroundColor() string

DefaultBackgroundColor returns the default color

func DefaultFlags

func DefaultFlags() string

DefaultFlags returns the default flags

func DefaultForegroundColor

func DefaultForegroundColor() string

DefaultForegroundColor returns the default color

func DefaultWidth

func DefaultWidth() int

DefaultWidth returns the default width

func FloatPrecision

func FloatPrecision() int

FloatPrecision returns the default precision

func GoldenRod

func GoldenRod(a interface{}, w ...interface{}) string

GoldenRod - return string based on the color given

func Green

func Green(a interface{}, w ...interface{}) string

Green - return string based on the color given

func Lavender

func Lavender(a interface{}, w ...interface{}) string

Lavender - return string based on the color given

func LightBlue

func LightBlue(a interface{}, w ...interface{}) string

LightBlue - return string based on the color given

func LightCoral

func LightCoral(a interface{}, w ...interface{}) string

LightCoral - return string based on the color given

func LightCyan

func LightCyan(a interface{}, w ...interface{}) string

LightCyan - return string based on the color given

func LightGreen

func LightGreen(a interface{}, w ...interface{}) string

LightGreen - return string based on the color given

func LightSalmon

func LightSalmon(a interface{}, w ...interface{}) string

LightSalmon - return string based on the color given

func LightSkyBlue

func LightSkyBlue(a interface{}, w ...interface{}) string

LightSkyBlue - return string based on the color given

func LightYellow

func LightYellow(a interface{}, w ...interface{}) string

LightYellow - return string based on the color given

func MediumBlue

func MediumBlue(a interface{}, w ...interface{}) string

MediumBlue - return string based on the color given

func MediumSpringGreen

func MediumSpringGreen(a interface{}, w ...interface{}) string

MediumSpringGreen - return string based on the color given

func MistyRose

func MistyRose(a interface{}, w ...interface{}) string

MistyRose - return string based on the color given

func Orange

func Orange(a interface{}, w ...interface{}) string

Orange - return string based on the color given

func Red

func Red(a interface{}, w ...interface{}) string

Red - return string based on the color given

func SetDefault

func SetDefault(foreground, background string, width, precision int, flags string)

SetDefault - create a colorize instance

func SetDefaultBackgroundColor

func SetDefaultBackgroundColor(color string)

SetDefaultBackgroundColor - Set the default background color

func SetDefaultFlags

func SetDefaultFlags(f string)

SetDefaultFlags - Set flags

func SetDefaultForegroundColor

func SetDefaultForegroundColor(color string)

SetDefaultForegroundColor - Set the default foreground color

func SetDefaultWidth

func SetDefaultWidth(w int)

SetDefaultWidth - Set the default width

func SetFloatPrecision

func SetFloatPrecision(w int)

SetFloatPrecision - Set float precision

func SkyBlue

func SkyBlue(a interface{}, w ...interface{}) string

SkyBlue - return string based on the color given

func Teal

func Teal(a interface{}, w ...interface{}) string

Teal - return string based on the color given

func Wheat

func Wheat(a interface{}, w ...interface{}) string

Wheat - return string based on the color given

func Yellow

func Yellow(a interface{}, w ...interface{}) string

Yellow - return string based on the color given

func YellowGreen

func YellowGreen(a interface{}, w ...interface{}) string

YellowGreen - return string based on the color given

Types

This section is empty.

Jump to

Keyboard shortcuts

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