Hi,
I have recently been writing a paper on how code can be used to solve modern design problems and really want to show off how interactive coding can be.
I am extremely interested yet sadly lack the knowledge and experience to create a simple but demonstrative Scene.
I want to be able to change the number of visible strokes by arrow keys and would love for the colors of the stroke to change depending on its length. (I figure this would create a nice harmony in color).
I was trying to change the color of the strokes through mouse but failed.
This (hints only!) will change the color of the lines:
for (int i = 0; i < NUM_LINES; i++)
{
float dist = dist( ?, ?, ?, ? );
println(dist); // get the range of dist and then comment it after
float hue = map(dist, ?, ?, 0, 360); //hue of 0 to 360
colorMode(HSB, 360, 100, 100); //HSB colorMode
stroke(hue, 100, 100); // set hue of line
line(x1(t +i), y1(t + i), x2(t + i), y2(t + i));
}
Look up the references for each line to first understand what they are doing and then complete the code.
I used HSB color mode to provide some nice colors.
Check out the tutorials and references on color.
Thanks so much! I’ve been trying to teach myself for some time now but it’s kind of hard when no one can correct you or show you how it’s done properly. I’m glad to have found the forum