/* Fully testable support object.  Could also put into server-side model if "general" for all types of clients, see Outcome.cs */
outcomeView = {
    description: function (rating) {
        if (rating === 10)
            return "Perfect!";
        else if (rating > 8)
            return "Great";
        else if (rating > 6)
            return "Good";
        else if (rating > 4)
            return "Fair";
        else return "Poor";
    },
    color: function (rating) {
        var red = 0, green = 0;
        if (rating <= 5) {
            red = 200;
            green = rating / 5.0;
            green *= 200.0;
        } else {
            green = 200;
            red = 1.0 - (rating - 5.0) / 5.0;
            red *= 200.0;

        }

        var rgb = "rgb(" + Math.round(red) + "," + Math.round(green) + ",0)";

        return rgb;
    }
}