const blueColor = "0,0.958507,1,1"; const redColor = "0.583333,0.037082,0,1"; const yellowColor = "0,0.583333,0.021181,1"; /** * 降雨颜色 * @param {*} val * @returns */ export function getColorByWaterQuality(val: number) { if (!val) { return "1,1,1"; } switch (val) { case 1: return "0,0.894330,1,1"; case 2: return "0.362375,1,0.276435,1"; case 3: return "0,0.583333,0.021181,1"; case 4: return "0.583333,0.037082,0,1"; case 5: return "0,0.583333,0.021181,1"; default: return ""; } }