color

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 2 Imported by: 2

README

Color

Go Reference

Minimal color package

color

Features

  • Simple API
  • Supports NO_COLOR

Install

go get github.com/livebud/color

Example

fmt.Fprintln(os.Stdout,
  color.Red("h"),
  color.Blue("e"),
  color.Yellow("l"),
  color.Green("l"),
  color.Pink("o"),
)

Contributors

License

MIT

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blue

func Blue(v ...interface{}) string

func Dim

func Dim(v ...interface{}) string

func Green

func Green(v ...interface{}) string

func Pink

func Pink(v ...interface{}) string

func Red

func Red(v ...interface{}) string

func Yellow

func Yellow(v ...interface{}) string

Types

type Writer

type Writer interface {
	Enabled() bool
	Blue(v ...interface{}) string
	Red(v ...interface{}) string
	Yellow(v ...interface{}) string
	Green(v ...interface{}) string
	Pink(v ...interface{}) string
	Dim(v ...interface{}) string
}

func Default

func Default() Writer

func Ignore

func Ignore() Writer
Example
package main

import (
	"fmt"

	"github.com/livebud/color"
)

func main() {
	color := color.Ignore()
	fmt.Println(color.Blue("hello"))
	fmt.Println(color.Red("hello"))
}
Output:

hello
hello

func New

func New() Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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