We are about to switch to a new forum software. Until then we have removed the registration on this forum.
After creating the program for color gradient, http://forum.processing.org/two/discussion/1487/gradient-from-17-colors-to-255-colors
I want to do the same but with a shape. As the following figure.
Any ideas to starting coding?
Answers
I think a good point to start would be a grid of vertices using a beginShape-endShape or PShape of kind TRIANGLES or QUADS. Give each point a color, for example blue, red or yellow. See the automatic color interpolation of OpenGL in action. Then start moving points around, adding/removing points etc. to get the shape and color distribution you want.
amnon thank you for your answer but I faced a lot of problems. Guys can you give me more help about this problem, how can do this?
One possible way:
Thank you very much for the answer.
I have only a question about the fill line which you convert thr RGB to:
I'm not sure if I understand what exactly you did.
fill(200 - 10*i, 200, i>=10? 20*(i-10) : 0);
200 - 10*i
-> greater the i darker the red channel.200
-> fixed bright green.i>=10? 20*(i-10) : 0
-> 1st half of the loop, blue is 0; 2nd half, greater the i lighter the blue.For the same question, I have the following code. Ι try to implement the same but not a square but in a shape like the shape at the beginning of the question.
I try this but I thing is wrong.