From f986c3c075959286ec732761e1344eb65198b45c Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Wed, 22 Feb 2017 17:34:23 -0800 Subject: [PATCH] adding some color helpers --- defaults.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/defaults.go b/defaults.go index 482d489..f6d13d3 100644 --- a/defaults.go +++ b/defaults.go @@ -103,6 +103,9 @@ var ( ColorAlternateYellow = drawing.Color{R: 240, G: 174, B: 90, A: 255} // ColorAlternateLightGray is a alternate theme color. ColorAlternateLightGray = drawing.Color{R: 187, G: 190, B: 191, A: 255} + + // ColorTransparent is a transparent (alpha zero) color. + ColorTransparent = drawing.Color{R: 0, G: 0, B: 0, A: 0} ) var ( @@ -171,6 +174,11 @@ var ( DashArrayDashesLarge = []int{10, 10} ) +// NewColor returns a new color. +func NewColor(r, g, b, a uint8) drawing.Color { + return drawing.Color{R: r, G: g, B: b, A: a} +} + // GetDefaultColor returns a color from the default list by index. // NOTE: the index will wrap around (using a modulo). func GetDefaultColor(index int) drawing.Color {