Module:ChartColors and Module:ChartColors/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
imported>Uzume
fix "OutlineColor" local
 
imported>Pppery
No edit summary
 
Line 2: Line 2:


local ARG = require "Module:Arguments"
local ARG = require "Module:Arguments"
local CFCM = require "Module:ComplForColorModules"
local CFCM = require "Module:ComplForColorModules/sandbox"
local TNTT = require "Module:TNTTools"
local TNTT = require "Module:TNTTools"
--local SD = require "Module:SimpleDebug"
local SD = require "Module:SimpleDebug"


local I18n = 'ChartColors'
local I18n = 'ChartColors'
Line 37: Line 37:
error (I18nStr ('ColorNameInvalid',ColorName))
error (I18nStr ('ColorNameInvalid',ColorName))
end
end
local MaxN = table.getn(Palet0)
MaxN = table.getn(Palet0)
if (N < 0) or (N > MaxN) then
if (N < 0) or (N > MaxN) then
error (I18nStr ('ColorNumInvalid',tostring(MaxN),tostring(N)))
error (I18nStr ('ColorNumInvalid',tostring(MaxN),tostring(N)))
else
else
local Palet = {}
Palet = {}
if IsInv then
if IsInv then
for i=MaxN, 1, -1 do
for i=MaxN, 1, -1 do
Line 106: Line 106:
end --ColorNameInvStartFromS
end --ColorNameInvStartFromS


local function ColorNameInv (args)
function ColorNameInv (args)
local S = args[1] or ''
local S = args[1] or ''
     local ColorName, IsInv, ParamsA = CFCM.ColorNameInvFromS0 (S)
     local ColorName, IsInv, ParamsA = CFCM.ColorNameInvFromS0 (S)
Line 119: Line 119:
});
});
local ColorName, IsInv, StartN = ColorNameInv (args)
local ColorName, IsInv, StartN = ColorNameInv (args)
local N = tonumber(args[2])
local N = tonum(args[2])
local WriteColor = args[3] or ""
local WriteColor = args[3] or ""
local ColorFound = {}
local ColorFound = {}
Line 134: Line 134:
removeBlanks = false
removeBlanks = false
})
})
local Nargs = require("Module:TableTools").length(args)
local ColorName, IsInv, StartN = ColorNameInv (args)
local ColorName, IsInv, StartN = ColorNameInv (args)
local N = tonumber(args[2])
local N = tonumber(args[2])
Line 141: Line 140:
local Labels = {}
local Labels = {}
local NLabels = 0
local NLabels = 0
local OutlineColor
local IsTemplate = true
local IsTemplate = true
ColorFound = p.GetColors (ColorName, IsInv, StartN, N, true)
ColorFound = p.GetColors (ColorName, IsInv, StartN, N, true)