Skip to content

Generate colours from hashes for repeatable username colouring, etc.

License

Notifications You must be signed in to change notification settings

Omnikron13/hash-colour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hash-colour

Generate colours from hashes for repeatable username colouring, etc.

Basic usage:

import hc "github.com/omnikron13/hash-colour"

c := hc.HSLuv("Omnikron13")

hx := hc.HexColour(c)

println(hx)

output: #558b5b


API Docs
--------

 - `HSLuv(name string) (sat, luv uint64, hue float64)`: Generate a colour from a string.
 - `HexColour(c color.Color) (hex string)`: Convert a color.Color to a hex colour string.
 - `c.RGBA() (r, g, b, a float64)`: Convert HSLuv to RGBA.

About

Generate colours from hashes for repeatable username colouring, etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages