From a2d0a4b5ce3221a74c5858692c9082f24bcfdc37 Mon Sep 17 00:00:00 2001 From: Alfred Chou Date: Thu, 27 Dec 2018 15:10:44 +0900 Subject: [PATCH] Added RGBA constructor. --- color/color.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/color/color.go b/color/color.go index d40e8480..97cdaccb 100644 --- a/color/color.go +++ b/color/color.go @@ -23,6 +23,12 @@ func RGB(r, g, b uint8) Color { return Color{r, g, b, 255, false} } +// RGBA constructs a new RGBA color with a given red, green, blue and alpha +// value. +func RGBA(r, g, b, a uint8) Color { + return Color{r, g, b, a, false} +} + // IsAuto returns true if the color is the 'Auto' type. If the // field doesn't support an Auto color, then black is used. func (c Color) IsAuto() bool {