I have a sketch that divides the screen into a bunch of vertical stripes, with each stripe drawn in a distinct color. I have the colors stored in an ArrayList and I use lerpColor() to gradually fade each stripe into the color of the next one:
float i = map(x, 0, width, 0, numberOfStripes - 1); int thisColor = (int) i; int nextColor = thisColor + 1; float progressBetween = i – thisColor; color = lerpColor(list.get(thisColor, nextColor, progressBetween);
I can do the same thing but with horizontal stripes just by changing the map():
float i = map(y, 0, height, 0, numberOfStripes - 1);
I’d like to do the same thing but with angled stripes (like diagonals, but not necessarily right at 45-degrees, could be more or less). Not quite sure how to think about this or set it up. Any suggestions greatly appreciated.