summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-01-26 13:51:38 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-01-26 13:51:38 -0500
commitb42376ba3da1e94bb5b4338db80ea6423653f3b3 (patch)
tree4f7eae721b30f2737b7a2bd103ba20d56de34ec3
parent1c5d79800fc82b2c257945394337d56dcb9b1b4d (diff)
downloadunifieddyes-b42376ba3da1e94bb5b4338db80ea6423653f3b3.tar
unifieddyes-b42376ba3da1e94bb5b4338db80ea6423653f3b3.tar.gz
unifieddyes-b42376ba3da1e94bb5b4338db80ea6423653f3b3.tar.bz2
unifieddyes-b42376ba3da1e94bb5b4338db80ea6423653f3b3.tar.xz
unifieddyes-b42376ba3da1e94bb5b4338db80ea6423653f3b3.zip
improve handling of greyscale in get-hsv function
-rw-r--r--init.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index e7eea42..1c4165d 100644
--- a/init.lua
+++ b/init.lua
@@ -97,7 +97,7 @@ function unifieddyes.is_buildable_to(placer_name, ...)
return true
end
-function unifieddyes.get_hsv(name)
+function unifieddyes.get_hsv(name) -- expects a node/item name
local hue = ""
local a,b
for _, i in ipairs(HUES) do
@@ -108,9 +108,13 @@ function unifieddyes.get_hsv(name)
end
end
- if string.find(name, "grey") then hue = "grey"
- elseif string.find(name, "white") then hue = "white"
- elseif string.find(name, "black") then hue = "black"
+ if string.find(name, "_light_grey") then hue = "light_grey"
+ elseif string.find(name, "_lightgrey") then hue = "light_grey"
+ elseif string.find(name, "_dark_grey") then hue = "dark_grey"
+ elseif string.find(name, "_darkgrey") then hue = "dark_grey"
+ elseif string.find(name, "_grey") then hue = "grey"
+ elseif string.find(name, "_white") then hue = "white"
+ elseif string.find(name, "_black") then hue = "black"
end
local sat = ""