colors

package
v0.35.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 11 Imported by: 6

Documentation

Index

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}
)
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",
}

ChartColor1 is the color palette for Google Charts as collected by Craig Davis here: https://gist.github.com/there4/2579834

Functions

func ColorAverage added in v0.33.1

func ColorAverage(c ...color.Color) color.Color

func ColorAverageImage added in v0.33.1

func ColorAverageImage(i image.Image) color.Color

func ColorRGBAToHex added in v0.33.1

func ColorRGBAToHex(c color.RGBA) string

func ColorString added in v0.33.6

func ColorString(c color.Color) string

ColorString returns a full 16-bit color representation.

func ColorToHex

func ColorToHex(c color.Color) string

ColorToHex returns 6 byte hex code in lower case.

func Equal added in v0.33.5

func Equal(c1, c2 color.Color) bool

func GetGoogleChartColors

func GetGoogleChartColors() []color.RGBA

func GoogleChartColorX

func GoogleChartColorX(index uint64) color.RGBA

func MatrixColumn added in v0.33.6

func MatrixColumn(m [][]color.Color, colIdx uint) ([]color.Color, error)

func MatrixUnique added in v0.33.6

func MatrixUnique(c [][]color.Color) []color.Color

func MustParse

func MustParse(input string) color.RGBA

MustParse returns a `color.RGBA` given a hex color code or Google color string. It panics if the input string cannot be parsed.

func Parse

func Parse(colorName string) (color.RGBA, error)

Parse returns a `color.RGBA` given a color name or hex color code.

func ParseGoogle

func ParseGoogle(googString string) (color.RGBA, error)

func ParseHex

func ParseHex(hexRGB string) (color.RGBA, error)

ParseHex returns a `color.RGBA` given a hex color code.

func SliceUnique added in v0.33.6

func SliceUnique(c []color.Color) []color.Color

Types

type Colors added in v0.33.3

type Colors []color.Color

func (Colors) In added in v0.33.3

func (clrs Colors) In(c color.Color) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL