func FromScale(input, min, max float64) float64 {
	return (input - math.Min(min, max)) / (math.Max(min, max) - math.Min(min, max))
}
FromScale returns a converted input from min, max to 0.0...1.0.
package gobot
import (
	"crypto/rand"
	"errors"
	"log"
	"math"
	"math/big"
	"time"
)
var (
	ErrUnknownEvent = errors.New("Event does not exist")
)
var eventError = func(e *Event) (err error) {
	if e == nil {
		err = ErrUnknownEvent
		log.Println(err.Error())
		return
	}
	return
}
func Every(t time.Duration, f func()) chan bool {
	done := make(chan bool)
	c := time.Tick(t)
	go func() {
		for {
			select {
			case <-done:
				return
			default:
				<-c
				go f()
			}
		}
	}()
	return done
}
func After(t time.Duration, f func()) {
	time.AfterFunc(t, f)
}
func Rand(max int) int {
	i, _ := rand.Int(rand.Reader, big.NewInt(int64(max)))
	return int(i.Int64())
}