ID:272797
 
Okay I have yet to use that argument as I've always just used as num for rgb and then use the rgb() proc to add color and whatnot.

So how do I use the as color arg to add color (yeah, betcha haven't been asked that before xD) to an icon o.O

mob/verb/AddColor()
var/Icon = 'whatever.dmi'
var/overcolor = input("","") as null|color
if(!overcolor) return
//Icon += rgb(overcolor) <-- obviously that won't work since rgb needs 3-4 args, not one
An input for color returns the color chosen (if one was) directly, so you don't need to do anything to get the color or something. It returns it in the same format as rgb(). So one way would be this:
mob/verb/add_color(C as color) src.icon += C
In response to Kaioken
var/Icon = 'whatever.dmi'
var/Color = input("","") as color
Icon += Color
overlays += Icon


How come that won't add the color to the icon?
In response to Spunky_Girl
Worked fine when I tested it.
In response to Andre-g1
Does the fact that it's in a Click() proc effect how it should be done any?

turf/whatever/Click()
var/Icon = 'whatever.dmi'
var/Color = input("","") as color
Icon += Color
usr.overlays += Icon


EDIT
Okay it started working now for some reason. Maybe because I had the Color var defined before the Icon var; I don't know. It just started working. >_> Thanks Kaioken. (and Andre for telling me that it SHOULD work I guess xD)