minor change

This commit is contained in:
faiface 2017-03-06 19:59:02 +01:00
parent f0394ec7d1
commit 15f0c6b7b2
2 changed files with 10 additions and 11 deletions

View File

@ -65,6 +65,16 @@ func (c NRGBA) RGBA() (r, g, b, a uint32) {
return
}
func clamp(x, low, high float64) float64 {
if x < low {
return low
}
if x > high {
return high
}
return x
}
// NRGBAModel converts colors to NRGBA format.
var NRGBAModel = color.ModelFunc(nrgbaModel)

11
util.go
View File

@ -1,11 +0,0 @@
package pixel
func clamp(x, low, high float64) float64 {
if x < low {
return low
}
if x > high {
return high
}
return x
}