a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by mike
mike  ·  3786 days ago  ·  link  ·    ·  parent  ·  post: Fractal Hubski explorer

Pressing 'c' or 'x' changes the background color. It starts at hubski orange rbg(237,99,8). Tapping 'c' adds 10 to R, subtracts 10 from G, and adds 15 to B. When a value goes out of range (<0 or >255), the value 'bounces' off the wall and changes direction. This gives a rather smooth color change through the world of rgb. What I think it cool is that the color is treated like a ball in 3d space which travels in a straight line bouncing off of the walls of a cube. Will it visit all colors? Will it ever bounce in a corner?





mitvit  ·  3786 days ago  ·  link  ·  

Your conception of a ball bouncing in a color cube is interesting. Because you are cycling by 10 among 256 choices, your R will always be odd and your G will always be even so you don't hit every color. Cycling by evens through evens maintains parity. However, your B will hit every value eventually.

As for corners, we'd need R=255, G=0, and B=255 OR B=0. However, whenever R is 255, G is always 246, because these values move antiparallel to each other.

mike  ·  3762 days ago  ·  link  ·  

Nice! What if all three values were relatively prime to 256, and relatively prime to each other? Kind of a neat math question. Imagine starting at 0,0,0 and having adding numbers of 3, 5 and 7 for example. We could even use "wraparound" (mod 256) to simplify it. Will every value (r,g,b) be reached?