adjust RGB doc

This commit is contained in:
faiface 2017-04-09 23:08:35 +02:00
parent e0615451b4
commit ed8abc4dc0
1 changed files with 4 additions and 1 deletions

View File

@ -10,11 +10,14 @@ type RGBA struct {
}
// RGB returns a fully opaque RGBA color with the given RGB values.
//
// A common way to construct a transparent color is to create one with RGB constructor, then
// multiply it by a color obtained from the Alpha constructor.
func RGB(r, g, b float64) RGBA {
return RGBA{r, g, b, 1}
}
// Alpha returns a while RGBA color with the given alpha component.
// Alpha returns a while RGBA color with the given alpha component.
func Alpha(a float64) RGBA {
return RGBA{a, a, a, a}
}