Трудно вам помочь, так как ваш вопрос действительно беспорядочный.В общем, это то, что вы можете искать (это машинопись):
yourArray.forEach((item, index) => {
if (index == 0 || index == 4 || index == 8 || index == 12) {
item.color = "red";
}
else if (index == 1 || index == 5 || index == 9) {
item.color = "green";
}
else if (index == 2 || index == 6 || index == 10) {
item.color = "yellow";
}
else {
item.color = "blue";
}
}
)