From 0e2fe00e572a084183b5d6939b1f75e73df3d87a Mon Sep 17 00:00:00 2001 From: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Date: Thu, 22 Dec 2022 01:00:47 +0000 Subject: [PATCH] Revert "Adds a helper proc to calculate luminance (#13190)" (#19968) This reverts commit 1d50569dcc57d29c74b83ab4d17fa98da55494a8. --- code/__HELPERS/icons.dm | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index cad37d4b92c..0283398b4e6 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -570,18 +570,6 @@ world /proc/BlendRGBasHSV(rgb1, rgb2, amount) return HSVtoRGB(RGBtoHSV(rgb1), RGBtoHSV(rgb2), amount) -//Returns the perceived brightness of a color. -//https://en.wikipedia.org/wiki/Relative_luminance -//https://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color -/proc/getLuminance(color) - var/list/RGB = ReadRGB(color) - var/R = RGB[1] - var/G = RGB[2] - var/B = RGB[2] - - var/Y = (0.2126 * R) + (0.7152 * G) + (0.0722 * B) - return clamp((Y * 0.01), 0, 1) //Returns the brightness of a color in decimal percentage format. Can multiply light_power by this to receive 100% brightness or a lower brightness. Not a higher brightness. - /proc/HueToAngle(hue) // normalize hsv in case anything is screwy if(hue < 0 || hue >= 1536) hue %= 1536