How do you invert color?

Discuss scenes and videos made with Algodoo.

How do you invert color?

Postby icrls984 » Mon Jun 02, 2014 6:22 am

I made a anti-gravity pad for my marble track :thumbup: , but I want to have the marble's color inverted, so I can figure out which are anti-gravity and which aren't. Thanks!
.
User avatar
icrls984
 
Posts: 80
Joined: Thu Jun 13, 2013 6:33 am

Re: How do you invert color?

Postby FRA32 » Sun Aug 09, 2015 1:39 pm

do do this simply type in the script of the pad:

"e.other.color = [1,1,1,2] - e.other.color"

the 2 is so the object wont get transparent.
FRA32
 
Posts: 229
Joined: Wed Dec 03, 2014 9:51 pm

Re: How do you invert color?

Postby T'wind_ » Sun Aug 09, 2015 9:24 pm

I recommend you to use this code so transparent objects remain transparent.

Code: Select all
e.other.color = [1 - e.other.color(0), 1 - e.other.color(1), 1 - e.other.color(2), e.other.color(3)]
User avatar
T'wind_
 
Posts: 86
Joined: Wed Jul 08, 2015 5:33 pm
Location: Western Europe


Return to Scenes

Who is online

Users browsing this forum: No registered users and 9 guests

cron