From fb4e4bcfce57741a16a7ddf8815788f43fae4d7a Mon Sep 17 00:00:00 2001 From: Seris02 Date: Sun, 16 Feb 2020 12:05:38 +0800 Subject: [PATCH] makes spraycans rely on HSL lightness instead of an addition of all the RGB values --- code/game/objects/items/crayons.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 81c5083ef7..d74bb28602 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -619,7 +619,7 @@ is_capped = TRUE self_contained = FALSE // Don't disappear when they're empty can_change_colour = TRUE - + reagent_contents = list(/datum/reagent/fuel = 1, /datum/reagent/consumable/ethanol = 1) pre_noise = TRUE @@ -710,7 +710,9 @@ if(isobj(target)) if(actually_paints) - if(color_hex2num(paint_color) < 350 && !istype(target, /obj/structure/window) && !istype(target, /obj/effect/decal/cleanable/crayon)) //Colors too dark are rejected + var/list/hsl = rgb2hsl(hex2num(copytext(paint_color,2,4)),hex2num(copytext(paint_color,4,6)),hex2num(copytext(paint_color,6,8))) + message_admins("[hsl]") + if(hsl[3] < 0.25 && !istype(target, /obj/structure/window) && !istype(target, /obj/effect/decal/cleanable/crayon)) //Colors too dark are rejected to_chat(usr, "A color that dark on an object like this? Surely not...") return FALSE