diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-01-26 13:51:38 -0500 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-01-26 13:51:38 -0500 |
commit | b42376ba3da1e94bb5b4338db80ea6423653f3b3 (patch) | |
tree | 4f7eae721b30f2737b7a2bd103ba20d56de34ec3 | |
parent | 1c5d79800fc82b2c257945394337d56dcb9b1b4d (diff) | |
download | unifieddyes-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.lua | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 = "" |