Jump to content
Search Community

inverse color

redon77 test
Moderator Tag

Recommended Posts

Hallo

 

I like tweenmax very much and use it a lot for all kind of tweenings. Now I have a problem and can't find a solution.

 

Is there a way to get inverse colors with tweenmax?

If an object is white it would be black afterwards, if it is red it would be some kind of green etc.

 

Any other ideas than using tweenmax?

 

Thank you

Link to comment
Share on other sites

No, a tweening engine isn't meant to do things like find inverse colors for you. I'm not positive this would work perfectly for you, but if I were you, I'd try separating the parts of the hex color into their red, green, and blue values (each of which will be an integer between 0 and 255) and then you get the inverse of each one (255 - currentValue) and recombine them into a hex color.

 

Hope that helps.

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