Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

gofor-little/colors

Repository files navigation

A package for ANSI color formatting

GitHub tag (latest SemVer pre-release) GitHub go.mod Go version License: MIT GitHub Workflow Status Go Report Card PkgGoDev

Introduction

  • ANSI color formatting for consoles
  • No dependencies outside the standard library

Example

package main

import (
	"fmt"

	"github.com/gofor-little/colors"
)

func main() {
	fmt.Println(colors.Black("Black"))
	fmt.Println(colors.BlackBright("BlackBright"))
	fmt.Println(colors.Red("Red"))
	fmt.Println(colors.RedBright("RedBright"))
	fmt.Println(colors.Green("Green"))
	fmt.Println(colors.GreenBright("GreenBright"))
	fmt.Println(colors.Yellow("Yellow"))
	fmt.Println(colors.YellowBright("YellowBright"))
	fmt.Println(colors.Blue("Blue"))
	fmt.Println(colors.BlueBright("BlueBright"))
	fmt.Println(colors.Magenta("Magenta"))
	fmt.Println(colors.MagentaBright("MagentaBright"))
	fmt.Println(colors.Cyan("Cyan"))
	fmt.Println(colors.CyanBright("CyanBright"))
	fmt.Println(colors.White("White"))
	fmt.Println(colors.WhiteBright("WhiteBright"))
}

Testing

Run go test ./... in the root directory.