[ENH] Smooth blob color changes

Sean McGrath sean at rosewood.his.ucsf.edu
Tue Jan 18 17:53:29 UTC 2000


 The Blob flashes too much as it crawls on my FreeCell board. Mixing a
little of the new color with the current color looks natural for a Blob.

Sean McGrath

!DavesBlobMorph methodsFor: 'stepping' stamp: 'sm 1/18/2000 09:29'!
adjustColors
        " Bob Arning <arning at charm.net>"
        " Color mixing - Sean McGrath <sean at email.ces.ucsf.edu>"
        | nearbyColors center r degrees |
        center _ bounds center.
        nearbyColors _ vertices
                                collect:
                                        [:each |
                                        degrees _ (each - center) degrees.
                                        r _ (each - center) r.
                                        Display colorAt: (Point r: r + 6 degrees: degrees)
                                                        + center].
        self color: (self color mixed: 0.95 with: (Color
                                r: (nearbyColors collect: [:each | each red]) average
                                g: (nearbyColors collect: [:each | each green]) average
                                b: (nearbyColors collect: [:each | each blue]) average)).
        sneaky ifFalse: [self color: color negated]! !





More information about the Squeak-dev mailing list