Documentation ¶
Overview ¶
Package altcolor includes useful color models absent in the standard library's "image/color" package. These are HSLA (Hue Saturation Lightness Alpha), HSVA (Hue Saturation Value Alpha) and HSIA (Hue Saturation Intensity/Brightness Alpha).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( SHORT_HEX = regexp.MustCompile("#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])?") LONG_HEX = regexp.MustCompile("#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})?") RGB = regexp.MustCompile("rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)") RGBA = regexp.MustCompile("rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)") )
var HSIAModel color.Model = color.ModelFunc(hsiaModel)
var HSLAModel color.Model = color.ModelFunc(hslaModel)
var HSVAModel color.Model = color.ModelFunc(hsvaModel)
Functions ¶
Types ¶
type HSIA ¶
type HSIA struct {
H, S, I, A float64
}
HSIA represents a colour with hue, saturation, intensity and alpha channels. All values are represented as floating point numbers with hue taking a value between 0 and 360, and the rest between 0 and 1.
Sometimes called HSBA (Hue Saturation Brightness Alpha)
type HSLA ¶
type HSLA struct {
H, S, L, A float64
}
HSLA represents a colour with hue, saturation, lightness and alpha channels. All values are represented as floating point numbers with hue taking a value between 0 and 360, and the rest between 0 and 1.