ID:157113
 
What I'm trying to do it to create an icon while the game is being played, while trying to add a certain rgb() value to it.

I've tried multiple times, and I've failed in every single one of them.
// Attempt #1
mob
verb
test()
var/icon/i = new('Light.dmi',"50")
i += rgb(1,1,1)
icon = i

// Attempt #2
mob
verb
test()
var/icon/i = new/icon('Light.dmi',"50")
i += rgb(1,1,1)
icon = i

// Attempt #3
mob
verb
test()
var/icon/i = icon('Light.dmi',"50")
i += rgb(1,1,1)
icon = i

Every single one of them return,

runtime error: type mismatch: /icon (/icon) += "#010101"
proc name: test (/mob/verb/test)
source file: Icon.dm,5
usr: Gooseheaded (/mob)
src: Gooseheaded (/mob)
call stack:
Gooseheaded (/mob): test()

But if I use
mob
verb
test()
var/icon/i = icon
i += rgb(1,1,1)
icon = i

I get no errors.

What do I have to do to get it done, properly?
What am I doing wrong?
Why the heck does it work with src.icon but not with a runtime-generated icon?


Thanks for reading!
No idea. Why not use Blend() and stuff from Lummox JR's IconProcs library?
In response to Skyspark
Because in that case, I'd have to make several icons, in order to Blend() them together; and that's exacgtly what I'm trying to avoid, but I guess that's the easiest and safest way of doing what I'm trying to do. *sighs*

I just wanted to stick to my idea, but... well...

Thanks.

Any other ideas?
In response to Garthor
Thanks everyone, Blend() should do it, especifally because it works with rgb() values as well.