/*
* @Project:getcolor
* @Author:zexi
* @Date:2022/11/24 15:18
* @Description:主要是获取不同值区间的颜色
* @Update:2022/11/24 15:18
*/

const getColorVal = (val)=>{
    let color;
    switch (true) {
        case val >= 0 && val < 1:
            color = "#fffdff";
            break;
        case val >= 1 && val <= 9.9:
            color = "#a6f28e";
            break;
        case val >= 10 && val <= 24.9:
            color = "#3db93d";
            break;
        case val >= 25 && val <= 49.9:
            color = "#61b8ff";
            break;
        case val >=50&&val<=99.9:
            color = "#0000fe";
            break;
        case val >=100&&val<=250:
            color = "#f900fb";
            break;
        case val >250:
            color = "#81013d";
            break;
        default:
            color = "#eaeaea";
            break;

    }
    return color
}
/**
 *温度图例颜色
 * @param val
 * @returns {string}
 */
const getWdColorVal=(val)=>{
    let color;
    switch (true) {
        case val < -12:
            color = "#032b8b";
            break;
        case val >= -12 && val < -8:
            color = "#195da7";
            break;
        case val >= -8 && val < -4:
            color = "#1d75d4";
            break;
        case val >= -4 && val < 0:
            color = "#3f9fe9";
            break;
        case val >= 0 && val < 4:
            color = "#82d1ff";
            break;
        case val >= 4 && val < 8:
            color = "#abe9f8";
            break;
        case val >= 8 && val < 12:
            color = "#cffcff";
            break;
        case val >= 12 && val < 16:
            color = "#f3fdee";
            break;
        case val >= 16 && val < 20:
            color = "#ccffcc";
            break;
        case val >= 20 && val < 24:
            color = "#bffb91";
            break;
        case val >= 24 && val < 28:
            color = "#fdfb96";
            break;
        case val >= 28 && val < 32:
            color = "#fef2c2";
            break;
        case val >= 32 && val < 35:
            color = "#fecda1";
            break;
        case val >= 35 && val < 37:
            color = "#f99782";
            break;
        case val >= 37 && val < 40:
            color = "#f55900";
            break;
        case val >= 40 :
            color = "#e60101";
            break;
       
        default:
            color = "#82d1ff";
            break;
    }
    return color
}
export {
    getColorVal,
    getWdColorVal
}
