Computer Science Canada

The color thing..

Author:  icexblood [ Sun Mar 16, 2008 6:48 pm ]
Post subject:  The color thing..

Whats the code to see every color in the program again?.. its like a slide show with the delay with every color it shows :S

Author:  jinjin [ Sun Mar 16, 2008 6:55 pm ]
Post subject:  Re: The color thing..

I think you might be referring to this:

code:

colour (0)
for bc:1..255
colourback(bc)
put bc
end for

Author:  A.J [ Sun Mar 16, 2008 7:03 pm ]
Post subject:  Re: The color thing..

Turing:

colour (0)
for bc : 1 .. 255
    colourback (bc)
    put bc
    delay (500)
end for

he wanted delay...

Author:  icexblood [ Sun Mar 16, 2008 7:07 pm ]
Post subject:  RE:The color thing..

thxx

Author:  Tony [ Sun Mar 16, 2008 7:44 pm ]
Post subject:  RE:The color thing..

I prefer something along the lines of
Turing:

for x : 1 .. 255
    Draw.Line(x,0,x,maxy,x)
end for

So that you can see all the colours at the same time.

Author:  Dan [ Sun Mar 16, 2008 8:06 pm ]
Post subject:  RE:The color thing..

You can also mix your own colors with the RGB moduel.

Author:  Sean [ Mon Mar 17, 2008 6:16 am ]
Post subject:  Re: The color thing..

Turing:

colour (0)
for c:1..255
    colourback(c)
    put " ",c," "..
end for


Shows every colour, with every box, on one screen, requiring no delays.

Author:  Tony [ Mon Mar 17, 2008 9:14 am ]
Post subject:  RE:The color thing..

what I like about drawing it line by line (though this will probably show up in blocks as well), is that you'll notice there's a really nice black-to-white gradient in one of the sections. It's quite good for animations and effects, without having to figure out RGB. module.

Author:  Zren [ Mon Mar 17, 2008 1:45 pm ]
Post subject:  Re: The color thing..

Modded the Scollbar GUI to make a colour contraption for the hell of it.



code:

import GUI

View.Set ("graphics:180;400,nobuttonbar")
var scrollBar : int

procedure ScrollBarMoved (value : int)
    for i : 0 .. 20
        locate (3 + i, 8)
        colorback (white)
        put 235 - value + i : 3
        locate (3 + i, 12)
        colorback (235 - value + i)
        put ""
    end for
end ScrollBarMoved

scrollBar := GUI.CreateVerticalScrollBar (10, 10, 380,
    0, 235, 235, ScrollBarMoved)

loop
    exit when GUI.ProcessEvent
end loop

Author:  riveryu [ Mon Mar 17, 2008 5:03 pm ]
Post subject:  RE:The color thing..

Zren, you could just set the y value of the screen very large and have the same effect as the scrollbar...
Good work anyways


: