ID:264766
 
Code:
        
Dye_Hair()
set src in view(1)
set name = "Dye Hair"
usr<<"Hair Stylist: Hey there, ever thought about changing the color of your hair?"
sleep(15)
switch(input("Would you like to dye your hair?", "Hair") in list("Yes", "No"))
if("Yes")
var/r = input("How much red?","Hair Color") as num
var/g = input("How much green?","Hair Color") as num
var/b = input("How much blue?","Hair Color") as num
usr.overlays -= usr.hairstyle
usr.hairstyle += rgb(r,g,b)
usr.overlays += usr.hairstyle
if("No")
return
Reset_Hair_Color()
set src in view(1)
set name = "Reset Hair Color"
usr.overlays -= usr.hairstyle
var/r = 0
var/g = 0
var/b = 0
usr.hairstyle = rgb(r,g,b)
usr<<"Hair Stylist: Now I can fix that if you'll just come back to me for a new hairstyle."
return


Problem description: I'd like the code to set the color back to 0r,0g,0b without it having to take off the hair overlay.

The appearance objects which make up the overlays list are read-only. You cannot modify them.
In response to Garthor
Alright, well, is there a way I can remove the overlay, set it back to 0r,0g,0b, and replace the overlay of the same hairstyle, without having to go back to the NPC and put the hair back on?
In response to Ryu-Kazuki
Yes. For an example, see [link]