Add color validation

This commit is contained in:
lopezloo 2023-02-10 13:56:00 +01:00
parent 0120bd5cc1
commit eaf4eecb38

View File

@ -54,7 +54,16 @@ SelectModel(model)
let td = document.createElement('td'); let td = document.createElement('td');
td.width = "16px"; td.width = "16px";
td.height = "16px"; td.height = "16px";
let col = VehicleColours[c[j]];
// GTA color ID
let colorID = c[j];
// RGB color
let col = VehicleColours[colorID];
if(!col) {
continue;
}
td.style = "background-color: rgb("+col[0]+","+col[1]+","+col[2]+")"; td.style = "background-color: rgb("+col[0]+","+col[1]+","+col[2]+")";
tr.appendChild(td); tr.appendChild(td);
} }