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

Username:   Password: 
 RegisterRegister   
 Searching and Comparing Colours
Index -> Programming, Turing -> Turing Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
scholarlytutor




PostPosted: Tue Nov 02, 2021 8:06 am   Post subject: Searching and Comparing Colours

I have a simple tutorial for today, and some files to go with it. Let's say you're fairly new to Turing and you're into graphics (like me). You start with using named colour codes like blue, red, green and so on (which correspond to colour codes 0 to 15), but you soon realize that there are unnamed colour codes that range from 16 to 255. Maybe you want to find orange. Well, what's an easy way to find it? Make your own custom programs for searching and comparing colours!

Here are two very simple programs I made which do just that. The first one simply loops through each colour from 16 to 255 every third of a second. When you come across one you like, click 'Pause' to pause the program. You can also click 'Resume' to keep searching, but if you want to start from the beginning, just press any key to end the program.

The second program divides the screen in 4 portions. Each portion has a drawfill command. Enter the colour codes you want to compare into the 000 slots in my program and you can take your time deciding exactly which colour you like best.

Finally, once you found a code you like, save it as a constant. You may even want to make a separate file that stores colour codes you like. So for Orange:

const Orange := 42

Finally, for those who feel limited by the 256 colours, there is an RGB module which allows you to use more. Take a look in the Turing reference/documentation for more information.

Of course, there are better programs you can make than these, as well as other colour tutorials you can read on Compsci.ca, but these programs are easy to understand if you're still fairly new to programming. Feel free to add other tips and examples in your comments.

That's all for today. Happy Turing programming!



Colour Compare.t
 Description:

Download
 Filename:  Colour Compare.t
 Filesize:  468 Bytes
 Downloaded:  104 Time(s)


Colour Search 256.t
 Description:

Download
 Filename:  Colour Search 256.t
 Filesize:  251 Bytes
 Downloaded:  111 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
TheTuringTest




PostPosted: Tue Nov 16, 2021 10:20 am   Post subject: RE:Searching and Comparing Colours

I don't even know how this all works yet but this looks useful! I'm excited to make some colourful computer programs.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: