ID:139829
 
Code:
proc
Outline(var/icon/II, color="#000000", inside=TRUE)
var/icon/I=new(II)

var/a=""
var/h=I.Height()
var/w=I.Width()
var/list/BadSpots=list()

for(var/Y=1 to h)
for(var/X=1 to w)
if(BadSpots.Find("[X],[Y]"))
continue
a = I.GetPixel(X,Y)
if(a == null)
continue
if(X>=w||X<=1||Y>=h||Y<=1)
continue
else
if(!I.GetPixel(X+1, Y))
I.DrawBox(color, X+1, Y, X+1, Y)
BadSpots+="[X+1],[Y]"
if(!I.GetPixel(X, Y+1))
I.DrawBox(color, X, Y+1, X, Y+1)
BadSpots+="[X],[Y+1]"
if(inside)
if(!I.GetPixel(X-1, Y))
I.DrawBox(color, X-1, Y, X-1, Y)
BadSpots+="[X-1],[Y]"
if(!I.GetPixel(X, Y-1))
I.DrawBox(color, X, Y-1, X, Y-1)
BadSpots+="[X],[Y-1]"
continue
return I


Problem description:
well i've been trying to figure out a way so that it would draw outlines over all the icon_states and i came up with the idea if using the icon_states() proc then using making a new icon of 1 of the icon_states and then drawing the outline around that. After all of that i would put that icon into the the icon im going to return. that might have sounded confusing to some people but anyway anyone know what i should do?
Easiest way to get an outline is to copy the icon, change it to a single color, and then make four copies of it, each shifted one pixel in one of the four cardinal directions. Then, paste the original icon on top of that.

Generally, you wouldn't want to do this at runtime, though.