On Jan 7, 2007, at 11:02 AM, Emile SCHWARZ wrote:

Hi all,


REALbasic 2007 Release 1
Mac OS X 10.4.8

Sorry for the not so clear subject. The problem is simple, but I do not know by which side I can handle it!

Say I want to draw a color gradiant (shade of colors) from RGB (255,127,0) to RGB(0,127,255) [I put arbitrary RGB values here since this can be the case: I ask the user the start and end colors and (s)he can place &c000000 or click on a Canvas rect to choose a color in the OS palettes]

How can I do that ?

Doing a simple shade of colors from say RGB(255,0,0) to RGB (0,255,0) can be considered as simple (I start to decrease the .Red atom from 255 and start to increase the .Green atom from 0).

If you do this, your half way point will be ( 127,127,0) This is a dark shade of yellow. If what you intend is for bright Yellow to be the mid point between Red and Green, then what you have to do is a little more complex. If you start with Red (255,0,0) then first you have to ramp the Green atom up to 255 so you are at ( 255,255,0 ) for the mid point, i.e. full yellow. Then you ramp the red atom to 0 to get to (0,255,0) i.e. Green




But for "complex colors", I'm short of ideas.

And I do not talked about the steps (say draw that in 30 lines!)...

Every help will be received with joy and smile will rose my face at reading time :)

TIA,

Emile


PS: I actually have the ability to create bars with color shades (on one color only) and the user settings: Width, height, Steps. The available colors are preset in a Popup Menu: basically, RGB (.Red, .Green, .Blue) and CMY (cyan, magenta, yellow) or black / greyscale colors.

It works fine, but you know how are the clients (our customers): you propose them a hand and they request a arm (give them a bicycle and they ask for a car!).

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to