Jump to content
Search Community

Search the Community

Showing results for tags 'Color'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

  1. So I need to just tween a color property of a Starling Display Object, but can't figure a way to do it with multiple objects. Right now, I have it working, but it only works on one TweenMax at a time as I need to assign it to a variable in order to get the current progress. Is there a way I could modify the TweenMax.to() function to get it to tween hex numbers correctly? onUpdate: tweenColorUpdate, onUpdateParams: [b, b.color, 0xB2B2B2] private function tweenColorUpdate(b:BlueCube, fromColor:Number, toColor:Number):void { b.color = DataModel.interpolateColor(fromColor, toColor, cubeColorTweenMax.currentProgress); } public static function interpolateColor(fromColor:uint, toColor:uint, progress:Number):uint { var q:Number = 1-progress; var fromA:uint = (fromColor >> 24) & 0xFF; var fromR:uint = (fromColor >> 16) & 0xFF; var fromG:uint = (fromColor >> 8) & 0xFF; var fromB:uint = fromColor & 0xFF; var toA:uint = (toColor >> 24) & 0xFF; var toR:uint = (toColor >> 16) & 0xFF; var toG:uint = (toColor >> 8) & 0xFF; var toB:uint = toColor & 0xFF; var resultA:uint = fromA*q + toA*progress; var resultR:uint = fromR*q + toR*progress; var resultG:uint = fromG*q + toG*progress; var resultB:uint = fromB*q + toB*progress; var resultColor:uint = resultA << 24 | resultR << 16 | resultG << 8 | resultB; return resultColor; }
×
×
  • Create New...