function generateObjectsWithColor(share) {
if (share < 1 || share > 100) {
throw new Error("Share parameter must be between 1 and 100");
}
const result = [];
for (let index = 1; index <= 100; index++) {
const color = index <= share;
result.push({ index, color });
}
return result;
}