color/README.md

28 lines
1.6 KiB
Markdown

# Golang Color Package
Provides several types for representing linear RGB and OkLab colours, compatible with the standard [color package](https://pkg.go.dev/image/color).
The types in this package use float64 components and are definitely overkill - you don't need 192 or 256 bit colour. Probably.
There are two main groups - the *linear RGB* colours, ideal for compositing; and the *OkLab* colors, ideal for comparing colours or for creating visually pleasing gradients.
## Installation
```bash
go get smariot.com/color
```
## Documentation
You can find the documentation at [pkg.go.dev](https://pkg.go.dev/smariot.com/color).
* *[smariot.com/color/lrgb](https://pkg.go.dev/smariot.com/color/lrgb)*: Linear RGB colour, no alpha.
* *[smariot.com/color/lrgba](https://pkg.go.dev/smariot.com/color/lrgba)*: Premultiplied linear RGBA colour.
* *[smariot.com/color/nlrgba](https://pkg.go.dev/smariot.com/color/nlrgba)*: Non-premultiplied linear RGBA colour.
* *[smariot.com/color/oklab](https://pkg.go.dev/smariot.com/color/oklab)*: OkLab colour, no alpha.
* *[smariot.com/color/oklaba](https://pkg.go.dev/smariot.com/color/oklaba)*: Premultiplied OkLab+Alpha color.
* *[smariot.com/color/noklaba](https://pkg.go.dev/smariot.com/color/noklaba)*: Non-premultiplied OkLab+Alpha colour.
* *[smariot.com/color/lgray](https://pkg.go.dev/smariot.com/color/lgray)*: Linear grayscale colour, no alpha.
* *[smariot.com/color/lgraya](https://pkg.go.dev/smariot.com/color/lgraya)*: Premultiplied linear grayscale+alpha colour.
* *[smariot.com/color/nlgraya](https://pkg.go.dev/smariot.com/color/nlgraya)*: Non-premultiplied linear grayscale+alpha colour.