Skip to content

Commit

Permalink
Color RGBA() multiply r, g, b by alpha.
Browse files Browse the repository at this point in the history
  • Loading branch information
mazznoer committed Feb 6, 2022
1 parent d57eb58 commit eb3c844
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions colorparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ type Color struct {

// Implement the Go color.Color interface.
func (c Color) RGBA() (r, g, b, a uint32) {
r = uint32(math.Round(c.R * 65535))
g = uint32(math.Round(c.G * 65535))
b = uint32(math.Round(c.B * 65535))
r = uint32(math.Round(c.R * c.A * 65535))
g = uint32(math.Round(c.G * c.A * 65535))
b = uint32(math.Round(c.B * c.A * 65535))
a = uint32(math.Round(c.A * 65535))
return
}
Expand Down

0 comments on commit eb3c844

Please sign in to comment.