2020-09-10 14:59:30 +00:00
|
|
|
# Hex Color Library for Go
|
|
|
|
|
2020-09-10 21:53:05 +00:00
|
|
|
 [](https://opensource.org/licenses/MIT) [](https://godoc.org/github.com/6543/go-hexcolor) [](https://goreportcard.com/report/github.com/6543/go-hexcolor)
|
|
|
|
|
2020-09-10 21:13:31 +00:00
|
|
|
## Features:
|
|
|
|
* Normalize/Parse hex color
|
|
|
|
* convert from/to color.RGBA
|
|
|
|
|
2020-09-10 14:59:30 +00:00
|
|
|
## ToDo
|
|
|
|
* [ ] Predefine standard colors (red, blue, ... based on CSS colors)
|
2020-09-21 04:48:40 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Download: `go get -u github.com/6543/go-hexcolor`
|
|
|
|
|
|
|
|
Example:
|
|
|
|
```go
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/6543/go-hexcolor"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
c, err := hexcolor.NewHexColor("#adf")
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
fmt.Println(c.ToString())
|
|
|
|
}
|
|
|
|
```
|
2020-09-21 04:49:10 +00:00
|
|
|
|
|
|
|
## Contribution
|
|
|
|
Fork repository, clone it, make changes, push to new branch and submit a pull request.
|