fading Color

Chris Burkert squeak-dev at lists.squeakfoundation.org
Mon Sep 30 16:24:49 UTC 2002


Boris Gaertner wrote:

> Chris Burkert <christian.burkert at s2000.tu-chemnitz.de> wrote:
>>
>>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 ?
>>
> 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 at 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 at 0);
>         direction: 100 at 0;
>         radial: false.
>    bc := BalloonCanvas extent: (200 @ 100) depth: 32.
>    bc fillRectangle: (0 at 0 extent: 200 @ 100)
>       fillStyle: fill.
> 
>   bc form displayAt: 10@ 10
> 
>  Hope this helps


Thanks a lot. That's exactly I was searching for.

Regards
            Chris Burkert
-- 
------------------------------------------------------------------------
Student of applied Computer Science at Chemnitz University of Technology
      http://www.chrisburkert.de/            chbu at hrz.tu-chemnitz.de
------------------------------------------------------------------------
"I invented the term Object-Oriented, and I can tell you I did not have
  C++ in mind." - Alan Kay --> http://www.squeak.org/




More information about the Squeak-dev mailing list