mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-26 17:33:49 +01:00
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.
This commit is contained in:
parent
3eb3a9a330
commit
e921095006
19
init.lua
19
init.lua
@ -514,6 +514,17 @@ function unifieddyes.getpaletteidx(color, palette_type)
|
|||||||
["darks50"] = 7,
|
["darks50"] = 7,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local shades_split = {
|
||||||
|
["faint"] = 0,
|
||||||
|
[""] = 1,
|
||||||
|
["s50"] = 2,
|
||||||
|
["light"] = 3,
|
||||||
|
["medium"] = 4,
|
||||||
|
["mediums50"] = 5,
|
||||||
|
["dark"] = 6,
|
||||||
|
["darks50"] = 7,
|
||||||
|
}
|
||||||
|
|
||||||
local shades_extended = {
|
local shades_extended = {
|
||||||
["faint"] = 0,
|
["faint"] = 0,
|
||||||
["pastel"] = 1,
|
["pastel"] = 1,
|
||||||
@ -597,8 +608,8 @@ function unifieddyes.getpaletteidx(color, palette_type)
|
|||||||
shade = "light"
|
shade = "light"
|
||||||
end
|
end
|
||||||
if palette_type == "split" then -- it's colorfacedir
|
if palette_type == "split" then -- it's colorfacedir
|
||||||
if hues_extended[color] and shades[shade] then
|
if hues_extended[color] and shades_split[shade] then
|
||||||
return (shades[shade] * 32), hues_extended[color]+1
|
return (shades_split[shade] * 32), hues_extended[color]+1
|
||||||
end
|
end
|
||||||
elseif palette_type == "extended" then
|
elseif palette_type == "extended" then
|
||||||
if hues_extended[color] and shades_extended[shade] 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 color = string.sub(s, 1, string.find(s, "s.png")-1)
|
||||||
|
|
||||||
local v = math.floor(param2/32)
|
local v = math.floor(param2/32)
|
||||||
if v == 0 then return "white" end
|
|
||||||
if color ~= "grey" then
|
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 == 2 then return color.."_s50"
|
||||||
elseif v == 3 then return "light_"..color
|
elseif v == 3 then return "light_"..color
|
||||||
elseif v == 4 then return "medium_"..color
|
elseif v == 4 then return "medium_"..color
|
||||||
|
Loading…
Reference in New Issue
Block a user