proc/AddColor(Color)
var/mob/Login_Mob/Pick_Char/P=usr
for(var/obj/hair/O in P.client.screen)
switch(Color)
if("red") O.icon += rgb(255,0,0)
if("brown") O.icon += rgb(153,102,0)
if("black") O.icon += rgb(17,17,17)
if("blue") O.icon += rgb(0,0,255)
if("green") O.icon += rgb(0,255,0)
if("pink") O.icon += rgb(255,100,150)
if("white") O.icon += rgb(225,225,225)
if("grey") O.icon += rgb(204,204,204)
if("yellow") O.icon += rgb(255,255,0)
Problem description:
Well, I'm sure this snippet should add the 'Color' to the player's hair which is 'O' and of course the player is 'P'.
Well, first of all, the type casting doesn't change a thing: you're still abusing usr in proc.
Second, you aren't allowed to search through client screen like this:
If you want to be able to reference the hair, then store it in a list.