ID:149942   Jan 21 2002, 5:19 pm is there a way to invert the colors in an icon? Thanks, FIREking p.s. if there are multiple ways, could you show me all of them?
 #1 Jan 21 2002, 5:21 pm The new swap button..
 #2 Jan 21 2002, 5:22 pm In response to Nadrew (#1) im talking about at run time, with code... FIREking
 #3 Jan 21 2002, 5:22 pm In response to FIREking (#2) I think there's also a swap() proc.
 #4 Jan 21 2002, 5:24 pm In response to Nadrew (#3) but how would i invert it? Sure you can swap one color with another color in an icon, but i would have to do that with all the rgb values? or is there a mathematical formula for calculating the invert? Thats what i want to know, what is the formula and procedure for making any possible combination icon inverted. FIREking
 #5 Jan 21 2002, 5:30 pm In response to FIREking (#4) rgb(255,255,255)-icon
 #6 Jan 21 2002, 5:35 pm In response to Xooxer (#5) Xooxer wrote: rgb(255,255,255)-icon so basically src.icon += rgb(255,255,255)-src.icon ? or src.icon = rgb(255,255,255)-src.icon ? Thanks, FIREking
 #7 Jan 21 2002, 5:36 pm In response to FIREking (#6) FIREking wrote: src.icon = rgb(255,255,255)-src.icon You're inverting the colours, not adding/subtracting anything.. think about it. --Tarmas.
 #8 Jan 21 2002, 5:36 pm In response to FIREking (#6) I believe: src.icon -= rgb(255,255,255) would be what you need... ~X
 #9 Jan 21 2002, 5:39 pm (Edited on Jan 21 2002, 5:47 pm) In response to Xooxer (#8) Thanks for being nice and helping me. Im not too swift when it comes to icon minipulation. Plus ive been in the ugly world of direct x for a few days, and havent been in the byond environment for a little while.  and one more thing. I seem to be having trouble restoring the icon to what it was before the change. For almost any operation. I want to be able to restore the icon back to what it was, without using initial because initial uses the VERY first instance of the icon, i would like to change it to the instance before the icon change. Ive tried something like mob/verb/test() var/icon/I = icon(src.icon,src.icon_state) var/icon/mem = icon(src.icon,src.icon_state) I.icon -= rgb(255,255,255) src.icon = I sleep(20) src.icon = mem but to no avial(right or wrong?), that fails the second or third time. and i was thinking about trying mob/verb/test() var/icon/I = icon(src.icon,src.icon_state) I.icon -= rgb(255,255,255) src.icon = I sleep(20) I.icon += rgb(255,255,255) src.icon = I but it seems that would not work. =\ Because im thinking that just adds the color white... [/edit] FIREking
 #10 Jan 21 2002, 5:43 pm In response to FIREking (#9) That was something I had requested a while back, and remembered that Lummox JR ( i think it was ) said that code snipet would invert the colors. I basicly pulled it from a previous post.... I have been trying to keep a professional attitude here as of late, so whatever my personal feelings are towards anyone, I'm trying not to let them interfere. In other words, your welcome. ~X :-)