ID:270634
 
I have a hair icon, but I'm having trouble setting the color. I have the player input 3 values as numbers, and then I Blend the icon like this:
var/icon/I = src
I.Blend(rgb(red,green,blue))
usr.overlays += I

But then I get the following error:
runtime error: undefined proc or verb /obj/Hair/DeLonge/Blend().

proc name: Click (/obj/Hair/Click)
source file: Objects.dm,53
usr: Seraphrevan (/mob/CreatingCharacter)
src: DeLonge (/obj/Hair/DeLonge)
call stack:
DeLonge (/obj/Hair/DeLonge): Click(White (6,6,3) (/turf/White))

Which points to this line of code:
I.Blend(rgb(red,green,blue))

Any help would be much appreciated.
You want to use Blend on src's icon, not src itself. Set I to src.icon.
var/icon/I = src.icon
In response to Loduwijk
I get the same error.
In response to Critical Productions
try this:
var/icon/I = new(src.icon)

I believe this worked with me when I had that problem, don't remember for sure now >_<

- GhostAnime
In response to GhostAnime
Hey, it worked! Thanks. Can anyone explain why I had to use new()?
In response to Critical Productions
It's simple. You can only adjust something that exists.

var/obj/o
src<<o.price

Take this for example. Will it work? Of course not. Why? 'o' is defined, but it is not created. It can't retreive information from the tree.

It's hard to explain, really. :<