color

package
v0.0.0-...-0ec6d47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CIELabModel color.Model = color.ModelFunc(cieLabModel)
View Source
var CIEXYZModel color.Model = color.ModelFunc(cieXYZModel)
View Source
var HSVModel color.Model = color.ModelFunc(hsvModel)

Functions

func DeltaECIE2000

func DeltaECIE2000(lab1, lab2 CIELab) float64

Get the CIE 2000 ΔE between 2 CIELab colors. A return value < 2.3 indicates a human probably would not notice any difference in the two colors.

func DeltaESqrCIE2000

func DeltaESqrCIE2000(lab1, lab2 CIELab) float64

func RGBToCIELab

func RGBToCIELab(r, g, b uint32) (labL, laba, labb float64)

Types

type CIELab

type CIELab struct {
	L, A, B float64
}

CIELab represents the CIE L*a*b* colorspace, 2° observer, D65 illuminant. See https://en.wikipedia.org/wiki/CIELAB_color_space#Forward_transformation Apologies for the uppercase member names ;)

func (CIELab) RGBA

func (c CIELab) RGBA() (r, g, b, a uint32)

Get a CIE Lab color as RGBA. This assumes sRGB ("Standard" RGB).

type CIEXYZ

type CIEXYZ struct {
	X, Y, Z float64
}

func (CIEXYZ) RGBA

func (c CIEXYZ) RGBA() (r, g, b, a uint32)

Get a CIE XYZ color as RGBA. This assumes sRGB ("Standard" RGB).

type HSV

type HSV struct {
	H, S, V float64 // TODO consider a fixed-point repr, e.g., int32
}

func (HSV) RGBA

func (c HSV) RGBA() (r, g, b, a uint32)

Conform to color.Color interface:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL