all files / circular-gauge/utils/ helper-axis-renderer.js

100% Statements 11/11
100% Branches 4/4
100% Functions 3/3
100% Lines 11/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16   1027× 1027× 1027× 1801× 1801× 1801×   1027×      
define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    function getRangeColor(value, ranges, color) {
        var min = 0;
        var max = 0;
        var currentRange = ranges.filter(function (range) {
            min = Math.min(range.start, range.end);
            max = Math.max(range.start, range.end);
            return (value >= min && max >= value);
        });
        return currentRange.length ? currentRange[0].rangeColor : color;
    }
    exports.getRangeColor = getRangeColor;
});