If the value of zoneTempDiff1
falls below 1.5, consider using temp: 1 color. If it exceeds 1.5, opt for temp: 2 color. The same logic applies to all different values such as -1, -2, 0, 1, 2, 3, 4, or 5, each corresponding to a specific color code. In cases where the value is greater than +6 or less than -6, use the respective colors for temp:+6 or temp:-6.
floor.entities.forEach(elementId => {
let objTemp: any = {};
objTemp.currentTemp = 68;
objTemp.desiredTempHeating = 70.5;
let zoneTempDiff1 = objTemp.currentTemp - objTemp.desiredTempHeating;
let tempColor1 = this.temperatureColors.filter(color => zoneTempDiff1 < (color.temp + 1) && zoneTempDiff1 > (color.temp - 1));
objTemp.tempColorToInsert = tempColor1.color;
floor.droppeditem.push(objTemp);
});
temperatureColors: any = [
{ color: '#50B3D3', temp: -6 },
{ color: '#25CBE4', temp: -4 },
{ color: '#25CBE4', temp: -3 },
{ color: '#7EE2DD', temp: -2 },
{ color: '#7EE2DD', temp: -1 },
{ color: '#89DE6F', temp: 0 },
{ color: '#89DE6F', temp: 1 },
{ color: '#D2E143', temp: 2 },
{ color: '#D2E143', temp: 3 },
{ color: '#FDCB31', temp: 4 },
{ color: '#FDCB31', temp: 5 },
{ color: '#F59A4A', temp: 6 }
];