Documentation
¶
Overview ¶
Provides a color.Color type for dealing with premultiplied linear grayscale+alpha colours.
Index ¶
- Variables
- func Distance(a, b Color) float64
- func DistanceSqr(a, b Color) float64
- type Color
- func (c Color) NLRGBA() (r, g, b, a float64)
- func (c Color) NLYA() (y, a float64)
- func (c Color) NOkLabA() (lightness, chromaA, chromaB, a float64)
- func (c Color) NRGBA() (r, g, b, a uint32)
- func (c Color) NXYZA() (x, y, z, a float64)
- func (c Color) NYA() (y, a uint32)
- func (c Color) RGBA() (r, g, b, a uint32)
- func (c Color) YA() (y, a uint32)
Constants ¶
This section is empty.
Variables ¶
A color.Model for converting arbitrary colours to a premultiplied linear RGBA Color.
Wraps the Convert function, returning a color.Color interface rather than the Color type.
Functions ¶
func Distance ¶
Distance returns the maximum possible euclidean distance between two colours, accounting for the possible backgrounds they might be composited over.
Types ¶
type Color ¶
type Color struct {
Y, A float64
}
Color is a pre-multiplied linear grayscale+alpha color.Color.
func (Color) NLRGBA ¶
NLRGBA converts to non-premultiplied linear RGBA.
func (Color) NLYA ¶
NLYA converts to non-premultiplied linear grayscale+alpha.
func (Color) NOkLabA ¶
NOkLabA converts to non-premultiplied OkLab+Alpha.
func (Color) NRGBA ¶
NRGBA converts to non-premultiplied RGBA.
func (Color) NXYZA ¶
NXYZA converts to non-premultiplied XYZ+Alpha.
func (Color) NYA ¶
NYA converts to non-premultiplied sRGB grayscale+alpha.
func (Color) RGBA ¶
RGBA converts to premultiplied RGBA, implementing the color.Color interface.