[MIRROR] Fix skin tone sorting and refactor color procs [MDB IGNORE] (#10210)

* Fix skin tone sorting and refactor color procs (#63554)

* Remove superfluous hash from hex2rgb call
Add stack_trace to hex2rgb to catch future nonsense

* Fix skin tone sorting and refactor color procs

Co-authored-by: AndrewL97 <andrewjlove97@gmail.com>
This commit is contained in:
SkyratBot
2021-12-23 17:46:08 +01:00
committed by GitHub
parent 3f6265f824
commit a0c805ff4c
6 changed files with 8 additions and 135 deletions

View File

@@ -182,7 +182,7 @@
new_color = input(user, "Choose a new color for [src]'s flashlight.", "Light Color",light_color) as color|null
if(!new_color)
return
if(color_hex2num(new_color) < 200) //Colors too dark are rejected
if(is_color_dark(new_color, 50) ) //Colors too dark are rejected
to_chat(user, span_warning("That color is too dark! Choose a lighter one."))
new_color = null
return set_flashlight_color(new_color)