go-opengl-pixel/util.go

12 lines
132 B
Go

package pixel
func clamp(x, low, high float64) float64 {
if x < low {
return low
}
if x > high {
return high
}
return x
}