Documentation ¶
Overview ¶
Package iro provides color interpolation functionality for multiple color spaces and convertions between them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Viridis = []Color{}/* 256 elements not displayed */
This function creates a vector of n equally spaced colors along the Matplolib 'viridis' color map created by Stéfan van der Walt and Nathaniel Smith. This color map is designed in such a way that it will analytically be perfectly perceptually-uniform, both in regular form and also when converted to black-and-white. It is also designed to be perceived by readers with the most common form of color blindness.
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color interface { // Interpolation methods. Lerp(Color, float64) Color // Color model convertion methods. HSV() HSV RGB() (float64, float64, float64) RGBA() RGBA StandardRGBA() color.RGBA }
Color should be able to interpolate between another color and convert to other color models.
type Gradient ¶
type Gradient struct { Colors []Color Stops []float64 Base Color // contains filtered or unexported fields }
Gradient contains colors and interpolation points to allow for non-uniform gradients. Also uses a base color for interpolations outside the gradient range.
func NewGradient ¶
NewGradient creates a new gradient from colors, stop points and a base color. Granularity controls the number of interpolated colors to pre-calculate.
type HSV ¶
type HSV struct {
H, S, V, A float64
}
HSV color model for more intuitive color manipulation and more aesthetic color interpolations.
func (HSV) Lerp ¶
Lerp interpolates between the two colors in the HSV color space. The shortest angle between the two colors in the HSV color space will be used.
Note: calling order matters for alpha interpolation.
func (HSV) StandardRGBA ¶
StandardRGBA returns a standard library version of the color.
type RGBA ¶
type RGBA struct {
R, G, B, A float64
}
RGBA is float color representation for easier interpolation and gradient creation.
func (RGBA) Lerp ¶
Lerp interpolates between the two colors in the RGB color space.
Note: calling order matters for alpha interpolation.
func (RGBA) StandardRGBA ¶
StandardRGBA returns a standard library version of the color.