void createDiamondShape(int x, int y, int size)
{
for(int i(0); i <= size; ++i) {
if(i!=size) {
SetPixel(x-i,y+(size-i));
SetPixel(x+i,y-(size-i));
}
if(i!=0) {
SetPixel(x+i,y+(size-i));
SetPixel(x-i,y-(size-i));
}
}
}
This seems to make the right shape for anything other than a size of 0. The x and y you pass are the centre of the diamond and the size is how many horizontal or vertical moves it would take to get from the centre to the edge of the diamond. Just call it with an incrementing size value and implement your own random colour algorithm.