func roundFloat64(value float64) float64 {
	if value < 0.0 {
		return value - 0.5
	}
	return value + 0.5
}
Utility function for rounding the value of a number.
package vibrant
import (
	"golang.org/x/image/draw"
	"image"
	"math"
)
func clampFloat64(value, min, max float64) float64 {
	if value < min {
		return min
	}
	if value > max {
		return max
	}
	return value
}
func clampUint8(value, min, max uint8) uint8 {
	if value < min {
		return min
	}
	if value > max {
		return max
	}
	return value
}