A library for generating random hexadecimal color codes
$ go get github.com/frankenbeanies/randhex
import "github.com/frankenbeanies/randhex
Generates a new random hexadecimal color code (RandHex)
hex := randhex.New()
Provides a string representation of the RandHex prepended with '#'
hexStr := randhex.New().String()
Provides the byte representation of the RandHex
hexBytes := randHex.New().Bytes()
Parses string into a RandHex
hex, _ := randhex.ParseString("#aaa")
hex, _ := randhex.ParseString("#AAAAAA")
hex, _ := randhex.ParseString("aaa")
_, err := randhex.ParseString("a") //error, bad length
_, err := randhex.ParseString("%aaa") //error, bad symbol
_, err := randhex.ParseString("#gaa") //error, not hex