Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

iris

A simple package to convert hex colors to ANSI256.

Usage

go get github.com/aboxofsox/iris

Setting Colors

package main

import (
        "fmt"
        "github.com/aboxofsox/iris"
)

func main() {
        text := iris.SetColor("hello world", "#010101", "#FF0000")
        fmt.Println(text)
} 

Setting Foreground Color

package main

import (
        "fmt"
        "github.com/aboxofsox/iris"
)

func main() {
        text := iris.SetFgColor("hello world", "#FF000")
        fmt.Println(text)
}

Setting Background Color

package main

import (
        "fmt"
        "github.com/aboxofsox/iris"
)

func main() {
        text := iris.SetBgColor("hello world" "#FF0000")
}

Stripping ANSI

package main

import (
        "fmt"
        "github.com/aboxofsox/iris"
)

func main() {
        text := iris.SetHex("hello world", "#FF0000")
        stripped := iris.Strip(text)
        fmt.Println(text, stripped)
}

About

A simple way to render hex colors in a terminal

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages