ID:2228234
 
Code:
obj
Appearance
Hair_Color
icon = 'Huds.dmi'
icon_state = "Paint"
var/COLOR = null
Click()
COLOR = input("") as color
if(COLOR != null)
usr:HairColor = lowertext(COLOR)
usr:Update_Appearance()
..()
Hair
pixel_x = 4
pixel_y = 4
Click()
usr:Hair = src.icon
usr:HairState = src.icon_state
usr:Update_Appearance()
..()
New()
var/icon/I = icon(src.icon)
I.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) //Turn gray
src.icon = I
..()
mob/Alive
Human
pixel_x = 4
pixel_y = 4
icon = 'Base.dmi'
var
Base = 'Base.dmi'
BaseState = ""

Hair = null
HairState = null
HairColor = null

PupilColor = null
proc
Update_Appearance()
src.icon = null
src.overlays = null
src.underlays = null

var/icon/IC = icon(Hair,HairState)
IC.ChangeColor(HairState)
var/image/IM = image(icon = IC, layer = 5.5)

var/icon/IC2 = icon(Base,BaseState)
var/image/IM2 = image(icon = IC2, layer = 5)

var/icon/IC3 = icon('Eye.dmi')
var/image/IM3 = image(icon = IC3, layer = 5.2)

var/icon/IC4 = icon('Pupil.dmi')
IC4.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
IC4.ChangeColor(PupilColor)
var/image/IM4 = image(icon = IC4, layer = 5.3)

src.overlays += list(IM,IM2,IM3,IM4)


var/global/hex=list("0"=0,"1"=1,"2"=2,"3"=3,"4"=4,"5"=5,"6"= 6,"7"=7,"8"=8,"9"=9,"a"=10,"b"=11,"c"=12,"d"=13,"e"=14,"f"=15)
icon
proc
ChangeColor(C)
var/R = hex[copytext(C,2,3)]*16+hex[copytext(C,3,4)]
var/G = hex[copytext(C,4,5)]*16+hex[copytext(C,5,6)]
var/B = hex[copytext(C,6,7)]*16+hex[copytext(C,7,8)]
src.MapColors(rgb(R,0,0), rgb(0,G,0), rgb(0,0,B))


Problem description:

I have a list of hair, I need to find a method for all hair to be in the same tone.
http://prnt.sc/eo6ti4
See? Some are lighter and some darker, I have no idea how to solve this, I tried a loop checking the color of each pixel and changing it, but I had no success.

Your ChangeColor() proc is basically doing multiplication the hard way. Multiply by the color and that's all you need.

To equalize the hairstyle lightnesses, that's something you should do in an image editor.