Skip to content

soypat/colorspace

Repository files navigation

colorspace

go.dev reference Go Report Card codecov Go sourcegraph

colorspace implements different color space logic to allow for conversion from colorspace to colorspace and interpolation within each colorspace.

How to install package with newer versions of Go (+1.16):

go mod download github.com/soypat/colorspace@latest

Linear interpolation example

Shown in each image are 5 different color gradients generated with linear interpolation in each available colorspace. See examples/lerp:

  1. Topmost: sRGB. This is the naive linear interpolation
  2. Linear sRGB.
  3. CIE XYZ
  4. OKLAB
  5. OKLCH. Designed to yield the most perceptively uniform gradient.

greyred to blue lerp red to blue lerp white to blue lerp white to black lerp

About

Color space definitions in Go: sRGB, OKLAB/OKLCH and CIE spaces.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages