/*
* @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 < 0.1:
            color = "#FFFFFF";
            break;
        case val >= 0.1 && val < 2.5:
            color = "#d9f9ce";
            break;
        case val >= 2.5 && val < 5:
            color = "#b4f7a3";
            break;
        case val >= 5 && val < 10:
            color = "#6dd969";
            break;
        case val >= 10 && val < 25:
            color = "#43b635";
            break;
        case val >= 25 && val < 50:
            color = "#62b7fb";
            break;
        case val >=50&&val<100:
            color = "#0000f7";
            break;
        case val >=100:
            color = "#fd00f9";
            break;
        default:
            color = "rgba(153,153,153,0.56)";
            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
}
