A command line tool and Go library to inspect and manipulate hex colors.
go install github.com/devkvlt/hexer/cmd/hexer@latest
Run hexer
or hexer help
to get a list of available commands.
Run hexer help <cmd>
to get detailed help about the command <cmd>
.
Here are some examples of usage:
# Mix red and green
hexer mix "#ff0000" "#008000"
# Darken red by 10
hexer darken "#ff0000" 10
# Get the contrast ratio between red and green
hexer contratio "#ff0000" "#008000"
# Make 5 colors representing gradient colors between red and green
hexer grad "#ff0000" "#008000" 5
go get github.com/devkvlt/hexer
package main
import (
"fmt"
"log"
"github.com/devkvlt/hexer"
)
func main() {
red := "#ff0000"
green := "#008000"
mix, err := hexer.Mix(red, green, 0.3)
if err != nil {
log.Fatal(err)
}
fmt.Println(mix)
}