float r1 = 255.0;
float g1 = 20.0;
float b1 = 147.0;
float r2 = 255.0;
float g2 = 215.0;
float b2 = 0.0;
void setup(){
size(500, 500);
loadPixels();
float rStep = (r1 - r2) / (width + height);
float gStep = (g1 - g2) / (width + height);
float bStep = (b1 - b2) / (width + height);
for(int h = 0; h < height; h++){
for(int w = 0; w < width; w++){
float r = r1 - (w + h) * rStep;
float g = g1 - (w + h) * gStep;
float b = b1 - (w + h) * bStep;
pixels[h * width + w] = color(r, g, b);
}
}
updatePixels();
}