Craig Denson wrote: > > george > > >> repeat 100 [ setpencolor 1 + random 8 > >> repeat 11 [for [i 0 359] [fd 1 rt (sin :i / 2)]]] > >> > ... > >setpencolor is not a single index it's a list of [red green blue] > > > >I personally do not like much code on one line because it's too hard to > >read and debug. You had 1 to many "]"'s also. > > thanks for the response - but i did this using ucblogo on a unix box > and it works as written. i was mostly interested in why it >appears< > to be a closed figure, although your suggestion for smoothly varying > colors is worth trying on a pc. > > a comment about setpencolor is that it seems too complicated to do > simple color changes. don't get me wrong, i like the flexibility, but > i might have considered a bit of indirection by having, say a palette > command that reconfigured the choices and leaving setpencolor to take > a single number as input. eg. > > palette [index | list of indices] [rgb vector | list of rgb vectors] > setpencolor index > > heck, you could have a third parameter that toggled the color space > between, say rgb, cmy, lhc and lab ... just kidding :-) > > i still haven't worked out the math of the petals yet... > > thanks again > craig I understand your concern about being complicated and the issue has been raised before. I personally don't believe that if something is complicated that it should be avoided. I also think in the case of color many folks "think" rgb would be complicated for a young student to understand. I personally think the single index method is complicated to understand because there is no relation between color 1 and color 2 etc. Kids learn about mixing colors to get other colors very early (before they can type). You can think of setpencolor [r g b] as the "color mixer". What if setpensize 1 gave you a penwidth 1 and setpensize 2 gave you a penwidth 10 and setpensize 3 gave you a width of 4. To me and a young student that's about how much sense setpencolor with an index makes. Just like setpencolor you could train the student that setpensize 1 is 1, 2 is 10 and 3 is 4. Just like you train them that setpencolor 1 is black, 2 is red etc. As you suggested rgb is flexible enough to allow you to simulate an indexed scheme and has been posted to logo-l by several folks (see logo-l archive [link is on my web page]). I also posted code for UCBLogo to simulate RGB but I'm not sure how it will behave on unix (it works on DOS). MSWLogo also allows really young students to just click on the basic color they want from a Choose Color Dialog with sliders for Red Green Blue and the color they will get. It can also help teach them how RGB colors are mixed to achieve the color they want. You can also add: to red setpencolor [255 0 0] end to green setpencolor [0 255 0] end and so on... to the library of young students. I also feel many Logo "experts" are not comfortable with RGB themselves and pass that along. RGB Should be as natural as setpensize. The setpencolor was done that way a long time ago when color pens on the turtle was very limited and even graphics terminals was limited to 16 colors if you were lucky. It's a whole new world when you algorithmically choose color (based on your suggestion of CMY and LHC, I think you know that already). The most I ever see with setpencolor using an index is "setpencolor random x" kinda boring if you ask me. The code I posted looks like a rose where it's dark in the inside and as you come closer it changes to red, it's looks truely 3d. -- =============================================================== George Mills email: mills@softronix.com http://www.softronix.com The www page contains some very powerful educational software. Our single most important investment is our kids. --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home