Computer Science Canada

RGB and GUI collide

Author:  Flikerator [ Sun Jan 01, 2006 8:32 pm ]
Post subject:  RGB and GUI collide

RGB and GUI mixed. Ive never used RGB and GUI is a joke. So I decided to combine them XD Enjoy.

code:

import GUI

var Setred, Setgreen, Setblue : int := 1
var Color : int := 25

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

procedure Blue (value : int)
    Setblue := value
    Text.Locate (4, 10)
    color (blue)
    put "Blue Value: ", Setblue : 4
end Blue

procedure Green (value : int)
    Setgreen := value
    Text.Locate (10, 10)
    colour (green)
    put "Green Value: ", Setgreen : 4
end Green

procedure Red (value : int)
    Setred := value
    Text.Locate (17, 10)
    colour (red)
    put "Red Value: ", Setred : 4
end Red

scrollBar := GUI.CreateHorizontalScrollBar (10, 210, 250, 1, 256, 1, Blue)
scrollBar := GUI.CreateHorizontalScrollBar (10, 110, 250, 1, 256, 1, Green)
scrollBar := GUI.CreateHorizontalScrollBar (10, 10, 250, 1, 256, 1, Red)

loop
    exit when GUI.ProcessEvent
    RGB.SetColor (Color, Setred, Setgreen, Setblue)
    locate (1, 1)
    color (Color)
    put "COLOR"
end loop

Author:  [Gandalf] [ Tue Jan 03, 2006 12:09 am ]
Post subject: 

I think you have the values backwards. See how when blue is at the max the text is not blue? It's more like 256 green and 256 red combined. In your program, having the slider at 0 is like having that RGB value at 256.


: