ID:267004
 
Ive just started to try out RGB proc and for some reason my bit of code isnt working can anyone tell me whats wrong??:

obj Shirt icon = 'Shirt.dmi' verb Change_Color() set src in oview(1) var/yn = input("Would you like to add some color to this shirt?")in list("Yes","No") switch(yn) if("Yes") var/icon/NewIcon = new /obj/Shirt var/R1 = input("Red?")as num var/G1 = input("Green?")as num var/B1 = input("Blue?")as num NewIcon.icon += rgb(R1,G1,B1) src.overlays += NewIcon

the problem is...the icon stays its default color(white) nothing changes....at all...Thanks for the help.

~Kros
try making the default icon black because rgb(0,0,0)is black
In response to Soori-99
O_O that explains alot i thought RGB black was 255,255,255...lol thanks Soori
K'ros Trikare wrote:
var/icon/NewIcon = new /obj/Shirt
var/R1 = input("Red?")as num
var/G1 = input("Green?")as num
var/B1 = input("Blue?")as num
NewIcon.icon += rgb(R1,G1,B1)
...
the problem is...the icon stays its default color(white) nothing changes....at all...Thanks for the help.

You've got a couple of problems here.

First off, if white is your base color, then you should be multiplying by the rgb(), not adding it.

Second: You're not using /icon properly. The .icon var and the += operator are totally inappropriate here. You should be using Blend() instead.

Lummox JR
In response to Lummox JR
Actually it works fine now...i can customize it later so that it sets the RGB not adds it...it just forgot that 0,0,0 isnt white.