Skip to content

Package hexcolor provides tools for working with hex color codes, for the Go programming language. Hex Color Codes look like these: #1B2A34, 1E5AA8, #fd0304, and 00852b.

License

Notifications You must be signed in to change notification settings

reiver/go-hexcolor

Repository files navigation

go-hexcolor

Package hexcolor provides tools for working with hex color codes, for the Go programming language.

Hex Color Codes look like these:

  • #1B2A34
  • 1E5AA8
  • #fd0304
  • 00852b

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-hexcolor

GoDoc

Example

Here is a simple example of parsing a hex color code:

var hexcode string = "#8A928D"

red, green, blue, err := hexcolor.Parse(hexcode)

And here is a simple example of creating a hex color code:

var red   uint8 = 0xB4
var green uint8 = 0x00
var blue  uint8 = 0x00

code := hexcolor.Format(red, green, blue)

Import

To import package hexcolor use import code like the follownig:

import "github.com/reiver/go-hexcolor"

Installation

To install package hexcolor do the following:

GOPROXY=direct go get https://github.com/reiver/go-hexcolor

Author

Package hexcolor was written by Charles Iliya Krempeaux

About

Package hexcolor provides tools for working with hex color codes, for the Go programming language. Hex Color Codes look like these: #1B2A34, 1E5AA8, #fd0304, and 00852b.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages