Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
jonForum

how tween with hex colors ? [solved]

Recommended Posts

hey guys , how gsap work to tween with hex colors tint ?
i get weird result.
 

    cs.tint = 0xffffff; // default
        TweenLite.to(cs, 0.6, {
        tint: 0x228200, // green
        ease: Power4.easeOut,
    });

 

N6L92043_o.gif

 

Existe a native method to compute hex color transition and keep green transition?

thanks

Link to comment
Share on other sites

yes this look perfect for me thank a lot for your fast answer.

  • Like 1
Link to comment
Share on other sites

Hi @jonForum 

 

If you're using PixiJS, the PixiPlugin can handle all your coloring needs and more.

 

var tl = new TimelineMax({ repeat: -1, yoyo: true })
  .to(sprite, 1, { pixi: { tint: "#ff0" }})
  .to(sprite, 1, { pixi: { tint: 0x2196F3 }})
  .to(sprite, 1, { pixi: { tint: "hsl(180, 90%, 60%)" }})
  .to(sprite, 1, { pixi: { tint: "rgb(236, 64, 122)" }});

 

 

See the Pen GPrRoM by osublake (@osublake) on CodePen

 

 

 

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×