Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Rainbow effect
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Zero




PostPosted: Fri Nov 28, 2003 10:03 am   Post subject: Rainbow effect

Well i was hoping that some one here could explain why this happens:
useing my oval (again) as an exmple; it works with anything aslong as you have a "for x/y:" as far as i know.

code:
setscreen ("graphic:vga")
for x : 0 .. 100 by 10
    for y : 0 .. 100 by 10
        drawoval (320, 240, x, y, y)
         delay(5)
    end for
end for


Why is it when you put the X or Y variable in for a colour you get this rainbow aray of colours for that shape?

(It turned out better then i thought, as one of my friends spent about aday or two trying to get this effect and now i get to rub it in his face Laughing )
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Nov 28, 2003 10:13 am   Post subject: (No subject)

because colors are represeted by a value 0-255

so since your x variable changes (because of the forloop), so are the colors that are being used for the ovals
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Zero




PostPosted: Fri Nov 28, 2003 10:38 am   Post subject: (No subject)

ooohhh, ok cool, Thanks Tony

and i hope this time the topic name is more to your liking Smile
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: