Jump to content
Search Community

how tween with hex colors ? [solved]

jonForum test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

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

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

  • 1 year later...

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.
×
×
  • Create New...