Computer Science Canada colour guide program |
Author: | neufelni [ Mon Apr 25, 2005 12:33 pm ] |
Post subject: | colour guide program |
Here is a program that gives the number and shows the colour of all 256 Turing colours. %Nick %April, 22/2005 %Colour Guide var col := 0 var do : string (1) loop put col Draw.FillBox (100, 100, 300, 300, col) getch (do) if do = (KEY_RIGHT_ARROW) then col := col + 1 cls elsif do = (KEY_LEFT_ARROW) then col := col - 1 cls end if end loop |
Author: | jamonathin [ Mon Apr 25, 2005 1:31 pm ] |
Post subject: | |
What if i wanna know what color 254 is? don't wanna have to wait that long. Try and make a program that's much faster, and displays all colors and numbers. There's a few of these types of programs on this site as well. |
Author: | Shyfire [ Tue Apr 26, 2005 1:23 pm ] |
Post subject: | |
you could make it faster |
Author: | dann_west [ Thu Apr 28, 2005 1:32 pm ] |
Post subject: | Re: colour guide program |
Pretty Good Nick but it is a slow program.You show make it so you type in a # and it shows the colour. |
Author: | DarkAng [ Thu May 12, 2005 3:30 pm ] | ||
Post subject: | colour | ||
here is one that i made that will be faster and lets u choose a colour
|
Author: | neufelni [ Wed May 25, 2005 11:05 am ] |
Post subject: | |
A few problems with DarkAng's program. First of all, if you choose to go through the colours one at a time, it goes way too fast to view the colours and the number, and you can't go back up, so you can't view the top colours again unless you restart the program. Secondly, because the numbers are in black you can't see what number the darker colours are. |
Author: | DarkAng [ Wed May 25, 2005 3:37 pm ] |
Post subject: | |
Nick wrote: A few problems with DarkAng's program. First of all, if you choose to go through the colours one at a time, it goes way too fast to view the colours and the number, and you can't go back up, so you can't view the top colours again unless you restart the program. Secondly, because the numbers are in black you can't see what number the darker colours are.
yes thats true but you can pause the program thats what the setscreen ("buttonbar") is for. + if you want to slow it down you can just increase the delay near the beginning of the program. i purposely made it faster so i could just scan through the colours |
Author: | Flikerator [ Thu May 26, 2005 1:20 pm ] |
Post subject: | |
For the second option you may want to error trap it so that if a number > 255 is entered then it doesn't exit the program. ![]() |
Author: | neufelni [ Thu May 26, 2005 2:03 pm ] | ||
Post subject: | |||
I made a better colour guide program so that you can see the number and you can easily view all the colours. Here it is :
|
Author: | the_binary_soul [ Fri May 27, 2005 9:36 am ] | ||
Post subject: | |||
here is my version I did last year. Probably could be made shorter... meh (did this last year I believe)
|
Author: | RaPsCaLLioN [ Fri May 27, 2005 10:12 am ] | ||
Post subject: | |||
Here's my version.
|
Author: | the_binary_soul [ Fri May 27, 2005 10:27 am ] |
Post subject: | |
damn, I'm beat.... only. How come black at the end shows up as 7. Should it not be 255? |
Author: | RaPsCaLLioN [ Fri May 27, 2005 1:33 pm ] |
Post subject: | |
meh... black is black |
Author: | jamonathin [ Fri May 27, 2005 4:54 pm ] | ||||
Post subject: | |||||
Guys, keep it simple. A color-guide program is something you can make fast, on the spot, not have to look it up and load it. try this.
And for better color results just put
|
Author: | Cervantes [ Fri May 27, 2005 5:53 pm ] | ||
Post subject: | |||
Except, it's a lot harder to use that. Each colour only appears as text and doesn't really allow you to see much about that colour. The light colours barely show up against white, and the dark colours barely show up against black. Also, there's no reason to not make this more complex. I agree, there are much better complex programs to spend time on. But that should not deter doing this; it should just bump it down the to do list. ![]() I prefer:
the_binary_soul wrote: How come black at the end shows up as 7. Should it not be 255? Delos in http://www.compsci.ca/v2/viewtopic.php?p=74095 wrote: Explanation: Original Turing had just a few colours (prolly ~1-8 ). Then they added more. The first few colours are based on maxing out RGB values. So, you've got Red, where: R:1.0, G:0.0, B:0.0 And somewhere Purple: R:1.0, G:0.0, B:1.0 and so on and so forth. This was fine for the limited graphics you could get in Classic Turing. Once the switch to OOT was made, 256 colours came into being. This started at around colour 17 or so, and was based on adding fractions to RGB instead of wholes so as to get a lot more colours. This meant that at some point, you'd get R:1.0, G:0.0, B:0.0 and such. Thus the duplication. Of course, they could've been clever and have reset the entire scheme so that it made sense...and they could've supported more than just freggin' 256 colours...but well, it's Holt and we don't question them (much). Now, of course, RGB has been implemented in a very limited fashion. Sure you can make new colours, but try load in a .jpg and read the colours at any point using whatdotcolour(). You'll only ever get values that read in the 0-255 range. Why? For some odd reason, OOT cannot take a pixel and return its true specific RGB values...only the ones it wants to believe they are...[sigh]. Anyhow, this can pose quite a problem for you if you're working w/ more than ~16 colours, and using whatdotcolour() as has just been demonstrated. |
Author: | bored_hacker [ Sun May 29, 2005 4:42 pm ] | ||
Post subject: | |||
I made this version the day after my compsci class started graphics. The teacher was impressed. (I added the Draw.Text, intstr, and offscreenonly later)
|
Author: | neufelni [ Mon May 30, 2005 10:44 am ] |
Post subject: | |
Pretty impresive, bored_hacker. I think that this is the best one I have seen. |
Author: | DarkAng [ Mon May 30, 2005 5:12 pm ] |
Post subject: | |
wow that blows mine away lol .. nice job .. its short too! |
Author: | TheOneTrueGod [ Mon May 30, 2005 10:10 pm ] | ||
Post subject: | Heres my version... | ||
heres a version I made... Click to "save" a colour.
|
Author: | jamonathin [ Tue May 31, 2005 8:04 am ] |
Post subject: | Re: Heres my version... |
TheOneTrueGod wrote: heres a version I made...
Click to "save" a colour. Don't you mean, Click to "close program due to programming error" |
Author: | phuong [ Tue May 31, 2005 11:16 am ] |
Post subject: | |
gah.... you guys are going so high tech with this. just look at my SIMPLE color file. ^^ |
Author: | GlobeTrotter [ Tue May 31, 2005 3:14 pm ] | ||
Post subject: | Re: Heres my version... | ||
OneTrueGod, here's a little mod of your program so that multiple boxes don't come up if you hold down the mouse.
|
Author: | phuong [ Wed Jun 01, 2005 9:31 am ] |
Post subject: | |
so how's my colour file? |
Author: | jamonathin [ Wed Jun 01, 2005 8:19 pm ] |
Post subject: | |
phuong wrote: so how's my colour file?
Its not bad. Just too much code. I've said this before in previous topic such as this, cuz there's like 20 this year on em. Color-guide proggy's should be short and simple. A colorguide program should be when you're sitting there programming your game, and you need a color, so you hit CTRL + N and juss whip together one in about 5 seconds. It shouldn't be any more than 6-7 lines. The one I use is only 4 ![]() |
Author: | phuong [ Thu Jun 02, 2005 11:03 am ] |
Post subject: | |
gah... i'm a newbe. not really actually. i've been in comp. sci. [class] for at least 5 months. well ok that's not that long and i still haven't learnt much. but hey. that's what i could come up with. check out my blackjack program. the topic title is: New Blackjack |