mob
verb
Hair_color()
var/obj/hair1 = new
var/R = input("How much red to you want in your hair?") as num
var/G = input("How much green to you want in your hair?") as num
var/B = input("How much blue to you want in your hair?") as num
if(R > 255)R=255
if(R < 0)R=0
if(G > 255)G=255
if(G < 0)G=0
if(B > 255)B=255
if(B < 0)B=0
hair1.icon += rgb(R,G,B)
src.overlays = list()
var/obj/hair1/H = new /obj/hair1
src.overlays += H
var/icon/I = new(src.icon)
I.Blend(I,ICON_OVERLAY)
src.icon = I
obj
hair1
icon = 'hair.dmi'
icon_state = "hair1"
Problem description:
When I compile and run, I have no errors or warnings. However, when I use the verb, it successfully adds the overlay and lets me put in the RGB values, but it doesn't actually change the color. Anybody have any ideas? (Sorry if its something obvious, I'm just coming back to BYOND from a 4 year break). Thank you for your time.
Edit: Just found one more bug. The hair isn't overlaying, but under-laying the character icon. :/ Thanks again
This is the code you're looking for: