Added RGBA constructor.

This commit is contained in:
Alfred Chou 2018-12-27 15:10:44 +09:00 committed by Todd
parent 29b701ce7b
commit a2d0a4b5ce

View File

@ -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 {