logo       

Re: fading Color: msg#00800

lang.smalltalk.squeak.general

Subject: Re: fading Color

You can make gradients by hand. Make sure the "property sheet" preference is on in "Preferences". Then click on the property sheet halo handle (near lower right corner). The sheet allows you to set colors, transparencies, gradients, drop shadows, etc.

I made the MoviePlayer look in just a few seconds. Note that the gradient tool allows both directions and origin to be changed ...

Cheers,

Alan

-----

At 5:14 PM +0200 9/30/02, Boris Gaertner wrote:
Chris Burkert <christian.burkert@xxxxxxxxxxxxxxxxxxxx> wrote:



Hi

I'm searching for a way to fill a Morph with more than one Color.
I hope 'fading Color' describes it well. The best example is the
MoviePlayer from the Widgetsflap but I didn't find how to get this
working. Can you help me ?

Regards
Chris Burkert
--
Chris,

have a look at MPEGMoviePlayerMorph>>moviePlayerFillStyle.
and search the senders of this method.

The point is that you have to define a GradientFillStyle. Such a thing
has an array of colors. Try this for different values of direction (100 @
0,
100@50, 100 @ 100) to get a feeling for fading coloring:

| fill bc |

fill _ GradientFillStyle ramp: {
0.0 -> (Color r: 0.05 g: 0.5 b: 1.0). "blue"
0.5 -> (Color r: 0.70 g: 0.85 b: 1.0). "almost white"
1.0 -> (Color r: 0.05 g: 0.5 b: 1.0)}. "blue again"
fill origin: (50@0);
direction: 100@0;
radial: false.
bc := BalloonCanvas extent: (200 @ 100) depth: 32.
bc fillRectangle: (0@0 extent: 200 @ 100)
fillStyle: fill.

bc form displayAt: 10@ 10

Hope this helps


--




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise