You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.4 KiB
Java
41 lines
1.4 KiB
Java
void gradientWindow(float minR, float minG, float minB, float maxR, float maxG, float maxB, float winSizeY){
|
|
|
|
float stepR = (maxR-minR)/(centerY-(winSizeY/2));
|
|
float stepG = (maxG-minG)/(centerY-(winSizeY/2));
|
|
float stepB = (maxB-minB)/(centerY-(winSizeY/2));
|
|
float winSizeX = (winSizeY/centerY)*centerX;
|
|
|
|
for (int x_pix = 0; x_pix < 2*centerX; x_pix ++){
|
|
for (int y_pix = 0; y_pix < 2*centerY; y_pix ++){
|
|
//Defines a rectagular window and gradient
|
|
if (abs(x_pix-centerX) >= abs(y_pix-centerY)) {
|
|
color c = color(0,0,round(abs(x_pix-centerX)-(winSizeX/2)*stepB));
|
|
/*color(round(abs(x_pix-centerX)-(winSizeX/2)*stepR),
|
|
round(abs(x_pix-centerX)-(winSizeX/2)*stepG),
|
|
round(abs(x_pix-centerX)-(winSizeX/2)*stepB));
|
|
*/
|
|
set(round(convertXCoord(x_pix)), round(convertYCoord(y_pix)), c);
|
|
|
|
} else {
|
|
color c = color(0,0,round(abs(y_pix-centerY)-(winSizeY/2)*stepB));
|
|
/*color(round(abs(y_pix-centerY)-(winSizeY/2)*stepR),
|
|
round(abs(y_pix-centerY)-(winSizeY/2)*stepG),
|
|
round(abs(y_pix-centerY)-(winSizeY/2)*stepB));
|
|
*/
|
|
set(round(convertXCoord(x_pix)), round(convertYCoord(y_pix)), c);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//Defines a circular window and gradient
|
|
|
|
|
|
|
|
|
|
}
|
|
|