mirror of
https://github.com/6543/go-hexcolor
synced 2024-12-18 15:54:17 +00:00
Impruve docs (#7)
* Add Usage Example (close #4) * Add Contribute Note (close #5) * add godocs docu
This commit is contained in:
parent
62213997bc
commit
344c8d43be
23
README.md
23
README.md
@ -8,3 +8,26 @@
|
|||||||
|
|
||||||
## ToDo
|
## ToDo
|
||||||
* [ ] Predefine standard colors (red, blue, ... based on CSS colors)
|
* [ ] 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.
|
||||||
|
33
doc.go
Normal file
33
doc.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// Copyright 2020 6543. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Package hexcolor is a simple hexcolor normalizer
|
||||||
|
|
||||||
|
Installation
|
||||||
|
|
||||||
|
go get -u github.com/6543/go-hexcolor
|
||||||
|
|
||||||
|
Example
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/6543/go-hexcolor"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
c, err := hexcolor.NewHexColor("#adf")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
fmt.Println(c.ToString())
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*/
|
||||||
|
package hexcolor
|
@ -1,3 +1,7 @@
|
|||||||
|
// Copyright 2020 6543. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package hexcolor
|
package hexcolor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
// Copyright 2020 6543. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package hexcolor
|
package hexcolor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Loading…
Reference in New Issue
Block a user