Skip to content

A package for converting `color.Color`s to ANSI color codes

License

Notifications You must be signed in to change notification settings

stroborobo/ansirgb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ansirgb

A package for converting color.Colors to ANSI color codes, 256 colors supported.

Example

package main

import (
	"fmt"
	"image/color"
	"github.com/stroborobo/ansirgb"
)

func main() {
	rgbColor := &color.RGBA{20, 80, 200, 255}
	ansiColor := ansirgb.Convert(rgbColor)
	fmt.Printf("%s%s\n", ansiColor.Fg(), "Foobar")
}

=> colored output (dark blue)

Installation

> go get github.com/stroborobo/ansirgb

Have fun :)

Documentation

Documentation is available at GoDoc.org.

About

A package for converting `color.Color`s to ANSI color codes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages