change float64 to float32 in colorToRGBA

This commit is contained in:
faiface 2016-12-01 17:54:27 +01:00
parent c192b684d3
commit 7446bec505
1 changed files with 5 additions and 5 deletions

10
util.go
View File

@ -3,11 +3,11 @@ package pixel
import "image/color"
// colorToRGBA converts a color from image/color to RGBA components in interval [0, 1].
func colorToRGBA(c color.Color) (r, g, b, a float64) {
func colorToRGBA(c color.Color) (r, g, b, a float32) {
ri, gi, bi, ai := c.RGBA()
r = float64(ri) / 0xffff
g = float64(gi) / 0xffff
b = float64(bi) / 0xffff
a = float64(ai) / 0xffff
r = float32(ri) / 0xffff
g = float32(gi) / 0xffff
b = float32(bi) / 0xffff
a = float32(ai) / 0xffff
return
}