diff --git a/color.go b/color.go index 86c9ca1..0303704 100644 --- a/color.go +++ b/color.go @@ -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) diff --git a/util.go b/util.go deleted file mode 100644 index 24e6199..0000000 --- a/util.go +++ /dev/null @@ -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 -}