Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/6543/go-hexcolor
normalize hexcolor, use predefined, ...
https://github.com/6543/go-hexcolor
color css css3 go golang golang-library hacktoberfest hexcolor lib webcolors
Last synced: 19 days ago
JSON representation
normalize hexcolor, use predefined, ...
- Host: GitHub
- URL: https://github.com/6543/go-hexcolor
- Owner: 6543
- License: mit
- Created: 2020-09-10T14:36:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-21T04:59:25.000Z (over 4 years ago)
- Last Synced: 2024-10-29T08:05:08.287Z (2 months ago)
- Topics: color, css, css3, go, golang, golang-library, hacktoberfest, hexcolor, lib, webcolors
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hex Color Library for Go
![Test](https://github.com/6543/go-hexcolor/workflows/Test/badge.svg?event=push) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![GoDoc](https://godoc.org/github.com/6543/go-hexcolor?status.svg)](https://godoc.org/github.com/6543/go-hexcolor) [![Go Report Card](https://goreportcard.com/badge/github.com/6543/go-hexcolor)](https://goreportcard.com/report/github.com/6543/go-hexcolor)
## Features:
* Normalize/Parse hex color
* convert from/to color.RGBA## ToDo
* [ ] Predefine standard colors (red, blue, ... based on CSS colors)## 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())
}
```## Contribution
Fork repository, clone it, make changes, push to new branch and submit a pull request.