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: 5 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址