summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-09-12 22:37:52 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-09-12 22:37:52 -0400
commite92109500660928d3815febe388cb8ba404a8b9b (patch)
tree10d74a6a02e9d93515be9ed90df010b7fe78bac0
parent3eb3a9a3304f07fc1b36f0e2ece945a0b660aa7e (diff)
downloadunifieddyes-e92109500660928d3815febe388cb8ba404a8b9b.tar
unifieddyes-e92109500660928d3815febe388cb8ba404a8b9b.tar.gz
unifieddyes-e92109500660928d3815febe388cb8ba404a8b9b.tar.bz2
unifieddyes-e92109500660928d3815febe388cb8ba404a8b9b.tar.xz
unifieddyes-e92109500660928d3815febe388cb8ba404a8b9b.zip
allow access to the 0 column in the split palettes
which now contains a "faint" shade of each color brings the total to 197 colors in split mode.
-rw-r--r--init.lua19
1 files changed, 15 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index 2466a85..e48ce52 100644
--- a/init.lua
+++ b/init.lua
@@ -514,6 +514,17 @@ function unifieddyes.getpaletteidx(color, palette_type)
["darks50"] = 7,
}
+ local shades_split = {
+ ["faint"] = 0,
+ [""] = 1,
+ ["s50"] = 2,
+ ["light"] = 3,
+ ["medium"] = 4,
+ ["mediums50"] = 5,
+ ["dark"] = 6,
+ ["darks50"] = 7,
+ }
+
local shades_extended = {
["faint"] = 0,
["pastel"] = 1,
@@ -597,8 +608,8 @@ function unifieddyes.getpaletteidx(color, palette_type)
shade = "light"
end
if palette_type == "split" then -- it's colorfacedir
- if hues_extended[color] and shades[shade] then
- return (shades[shade] * 32), hues_extended[color]+1
+ if hues_extended[color] and shades_split[shade] then
+ return (shades_split[shade] * 32), hues_extended[color]+1
end
elseif palette_type == "extended" then
if hues_extended[color] and shades_extended[shade] then
@@ -775,9 +786,9 @@ function unifieddyes.color_to_name(param2, def)
local color = string.sub(s, 1, string.find(s, "s.png")-1)
local v = math.floor(param2/32)
- if v == 0 then return "white" end
if color ~= "grey" then
- if v == 1 then return color
+ if v == 0 then return "faint_"..color
+ elseif v == 1 then return color
elseif v == 2 then return color.."_s50"
elseif v == 3 then return "light_"..color
elseif v == 4 then return "medium_"..color