Documentation
¶
Index ¶
- Variables
- func CanonicalHex(hexRGB string, upperCase, addHash bool) (string, error)
- func CanonicalHexes(hexRGBs []string, upperCase, addHash, dedupeResults, sortResults bool) ([]string, error)
- func ColorAverage(c ...color.Color) color.Color
- func ColorAverageImage(i image.Image) color.Color
- func ColorRGBAToHex(c color.RGBA) string
- func ColorString(c color.Color) string
- func ColorToHex(c color.Color, upperCase, addHash bool) string
- func ConvertBits8To24(c, a uint8) int
- func Equal(c1, c2 color.Color) bool
- func GetGoogleChartColors() []color.RGBA
- func GoogleChartColorX(index uint64) color.RGBA
- func MatrixColumn(m [][]color.Color, colIdx uint) ([]color.Color, error)
- func MatrixUnique(c [][]color.Color) []color.Color
- func MustParse(input string) color.RGBA
- func MustParseHex(hexRGB string) color.RGBA
- func Parse(colorName string) (color.RGBA, error)
- func ParseGoogle(googString string) (color.RGBA, error)
- func ParseHex(hexRGB string) (color.RGBA, error)
- func SliceUnique(c []color.Color) []color.Color
- type Colors
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Red = color.RGBA{R: 255, G: 0, B: 0, A: 255} Green = color.RGBA{R: 0, G: 255, B: 0, A: 255} Blue = color.RGBA{R: 0, G: 0, B: 255, A: 255} Orange = color.RGBA{R: 255, G: 165, B: 0, A: 255} ANSIBlackHex = "000000" ANSIRedHex = "800000" ANSIGreenHEx = "008000" ANSIYellowHex = "808000" ANSIBlueHex = "000080" ANSIMagentaHex = "800080" ANSICyanHex = "008080" ANSIWhiteHex = "c0c0c0" // colors from: https://github.com/badges/shields/blob/18e17233c49cf94f9a32115c3fcdc439cb495086/badge-maker/lib/color.js#L7 ShieldBlueHex = "007ec6" ShieldBrightGreenHex = "44cc11" ShieldGreenHex = "97ca00" ShieldGreyHex = "555555" ShieldLightGreyHex = "9f9f9f" ShieldOrangeHex = "fe7d37" ShieldRedHex = "e05d44" ShieldYellowHex = "dfb317" ShieldYellowGreenHex = "a4a61d" )
View Source
var GoogleChartColors = GetGoogleChartColors()
View Source
var GoogleChartColorsHex = [...]string{
"#3366CC",
"#DC3912",
"#FF9900",
"#109618",
"#990099",
"#3B3EAC",
"#0099C6",
"#DD4477",
"#66AA00",
"#B82E2E",
"#316395",
"#994499",
"#22AA99",
"#AAAA11",
"#6633CC",
"#E67300",
"#8B0707",
"#329262",
"#5574A6",
"#3B3EAC",
}
GoogleChartColorsHex is the color palette for Google Charts as collected by Craig Davis here: https://gist.github.com/there4/2579834
Functions ¶
func CanonicalHex ¶ added in v0.62.7
func CanonicalHexes ¶ added in v0.62.7
func ColorRGBAToHex ¶ added in v0.33.1
func ColorString ¶ added in v0.33.6
ColorString returns a full 16-bit color representation.
func ColorToHex ¶
ColorToHex returns 6 byte hex code in lower case.
func ConvertBits8To24 ¶ added in v0.67.6
ConvertBits8To24 converts a 8 bit color (`color.RGBA`) to a 24 bit color. `a` is the alphachannel.
func GetGoogleChartColors ¶
func GoogleChartColorX ¶
func MatrixColumn ¶ added in v0.33.6
func MustParse ¶
MustParse returns a `color.RGBA` given a hex color code or Google color string. It panics if the input string cannot be parsed.
func MustParseHex ¶ added in v0.67.6
Types ¶
Click to show internal directories.
Click to hide internal directories.