Skip to content
/ hexer Public

A command line tool and Go library to inspect and manipulate hex colors.

License

Notifications You must be signed in to change notification settings

devkvlt/hexer

Repository files navigation

Hexer

Go version Go Report Card Build Tests Coverage License

A command line tool and Go library to inspect and manipulate hex colors.

Installation

go install github.com/devkvlt/hexer/cmd/hexer@latest

Usage

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

Usage as a library

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)
}

About

A command line tool and Go library to inspect and manipulate hex colors.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published