https://github.com/reiver/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, and 00852b.
https://github.com/reiver/go-hexcolor
hex-code hex-codes hex-color hex-color-code hex-color-codes hex-colors
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/reiver/go-hexcolor
- Owner: reiver
- License: mit
- Created: 2024-02-23T05:20:50.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-23T05:28:46.000Z (about 1 year ago)
- Last Synced: 2025-01-25T13:08:11.287Z (4 months ago)
- Topics: hex-code, hex-codes, hex-color, hex-color-code, hex-color-codes, hex-colors
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
[](https://godoc.org/github.com/reiver/go-hexcolor)
## Example
Here is a simple example of parsing a hex color code:
```golang
var hexcode string = "#8A928D"
red, green, blue, err := hexcolor.Parse(hexcode)
```And here is a simple example of creating a hex color code:
```golang
var red uint8 = 0xB4
var green uint8 = 0x00
var blue uint8 = 0x00code := 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](http://changelog.ca)