ID:187527
 
can someone help me find a RGB demo where the person can punch what color they want
proc/input_rgb(mob/M)
if(usr&&!M)M=usr
var
r;g;b
r=input(M,"Input a number from 0 to 255","Red")as num
g=input(M,"Input a number from 0 to 255","Green")as num
b=input(M,"Input a number from 0 to 255","Blue")as num
if(r<0)r=0
if(g<0)g=0
if(b<0)b=0
if(r>255)r=255
if(g>255)g=255
if(b>255)b=255
return rgb(r,g,b)

Call that as you would call an alert or input.

I'm not sure whether or not the rgb function returns 0/255 if you go out of the range. You can run a li'l test if you want, and if it does you can take out those 6 lines with if statements.