Documentation
¶
Index ¶
- func ColorInSpace(values []float64, space ColorSpace) color.Color
- func Mix(target color.Color, palette *Palette, space ColorSpace) (color.Color, error)
- type Color
- type ColorMeta
- func (c ColorMeta) AlternativeName() string
- func (c ColorMeta) BrandName() string
- func (c ColorMeta) Name() string
- func (c ColorMeta) SerialNo() string
- func (c *ColorMeta) SetAlternativeName(name string)
- func (c *ColorMeta) SetBrandName(name string)
- func (c *ColorMeta) SetFormatter(fn func() string)
- func (c *ColorMeta) SetName(name string)
- func (c *ColorMeta) SetSerialNo(v string)
- func (c ColorMeta) String() string
- type ColorSpace
- type Palette
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorInSpace ¶
func ColorInSpace(values []float64, space ColorSpace) color.Color
ColorInSpace returns a Color in specific color space
Types ¶
type Color ¶
Color named color
func (Color) Dense ¶
func (c Color) Dense(colorSpace ColorSpace) *mat.VecDense
Dense returns vec dense of color
func (Color) SpaceValues ¶
func (c Color) SpaceValues(space ColorSpace) (float64, float64, float64)
SpaceValues returns float64 values for a specific color space of color
type ColorMeta ¶ added in v1.0.1
type ColorMeta struct {
// contains filtered or unexported fields
}
func (ColorMeta) AlternativeName ¶ added in v1.0.1
AlternativeName returns the alternative name of color
func (*ColorMeta) SetAlternativeName ¶ added in v1.0.1
SetAlternativeName update the color alternative name
func (*ColorMeta) SetBrandName ¶ added in v1.0.1
SetBrandName update the color brand name
func (*ColorMeta) SetFormatter ¶ added in v1.0.1
SetFormatter set String formatter for color meta
func (*ColorMeta) SetSerialNo ¶ added in v1.0.1
SetSerialNo update the color serial number
type ColorSpace ¶
type ColorSpace int
const ( RGB ColorSpace = iota // LAB CIE-L*a*b*: A perceptually uniform color space, i.e. distances are meaningful. L* in [0..1] and a*, b* almost in [-1..1]. LAB // HSL Hue in [0..360], Saturation and Luminance in [0..1]. For legacy reasons; please forget that it exists. HSL // HSV Hue in [0..360], Saturation and Value in [0..1]. You're better off using HCL HSV // LUV CIE-L*u*v*: Very similar to CIE-L*a*b*, there is no consensus on which one is "better". LUV // LCH CIE-L*C*h° (HCL): This is generally the most useful one; CIE-L*a*b* space in polar coordinates, i.e. a better HSV. H° is in [0..360], C* almost in [0..1] and L* as in CIE-L*a*b*. LCH // HSLuv: The better alternative to HSL, see here and here. Hue in [0..360], Saturation and Luminance in [0..1]. HSLuv // HPLuv: A variant of HSLuv. The color space is smoother, but only pastel colors can be included. Because the valid colors are limited, it's easy to get invalid Saturation values way above 1.0, indicating the color can't be represented in HPLuv because it's not pastel. HPLuv // HCL HCL )
type Palette ¶
type Palette struct {
// contains filtered or unexported fields
}
Palette is named color palette
func NewPalette ¶
NewPalette returns a new palette instance
func (Palette) Dense ¶
func (p Palette) Dense(colorSpace ColorSpace) *mat.Dense
Dense returns a mat dense of palette
Click to show internal directories.
Click to hide internal directories.