how to fill in the round with fill gradually changing color

edited February 2018 in How To...

does processing has some function for that? if it has,can it be used to fill gradually changing color more than two color? it's easy to draw line to fill gradually changing color to rectangles,but it's round,so i have no idea. Hope sb can help me,thanks in preference!

Answers

  • When you start a message by "How To", it is a sign it should go to the section with the same name... :-) (I moved it there.)

    "gradually changing color"
    In general, we call this a "gradient" (or color gradient).

    If it is round, a way to do this is to use mask().

    I have an example of mask usage with a PImage, but you can drawn your gradient on a PGraphics and do the same thing with a shape of rounded rectangle.

  • I would do something more simple if you are planning for some type of game...

    if (turnItIntoAVariableAndPlaceItHere === it’s X or Y ){ fill(random); ellipse(last circles X, last circles Y, Same W, same H); }

  • October 2013...

Sign In or Register to comment.