logo       

Re: fading Color: msg#00796

lang.smalltalk.squeak.general

Subject: Re: fading Color


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