The following creates an RGB color selector. Slide the red, green, and blue 
sliders to increase the intensity of the color. Click on the frame below the 
sliders to return the new color value.

One problem: If you do not move all three sliders initially before clicking on 
the frame, the script deals with a /data value of "none" and returns an error. 
Can someone help me on this one? How can I preset the /data value for a 
slider to zero so that it doesn't return "none" ?

Thanks.

-Ryan


REBOL []

rgb-color-selector: layout [
        backdrop 255.255.255
        across
        red: slider 10x259 [red/color: 255.0.0 + (255 - red/data) show red print 
red/data]
        green: slider 10x259 [green/color: 0.255.0 + (255 - green/data) show 
green print green/data]
        blue: slider 10x259 [blue/color: 0.0.255 + (255 - blue/data) show blue 
print blue/data]
        return
        rgb: frame 50x50 [rgb/color: make tuple! rejoin [red/data {.} green/data {.} 
blue/data] show rgb]
]

view rgb-color-selector

Reply via email to