Differenze tra le versioni di "Modulo:ChooseColor"

Vai alla navigazione Vai alla ricerca
Moving function for text color on Pokémon gradient from ChooseColor to PokémonData (step 1) *** sovrascritto il testo esistente ***
m (Temporary rollback of function "forPokeTypes")
(Moving function for text color on Pokémon gradient from ChooseColor to PokémonData (step 1) *** sovrascritto il testo esistente ***)
local p = {}
 
local tabstr = require('Modulo:Wikilib/tablesstrings') -- luacheck: no unused
local w = require('Modulo:Wikilib')
local multigen = require('Modulo:Wikilib/multigen')
local pdformlib = require('Modulo:PokémonDataWikilib/forms')
local colorMod = mw.loadData('Modulo:Colore/data')
local colorschemeMod = mw.loadData('Modulo:Colorscheme/data')
-- Given a background hex color, return the most appropriate text color
p.forBg = function(frame)
return p.forBgLua(string.trim(frame.args[1]))
end
 
end
 
local pd = require('Modulo:PokémonData')
-- when colors are types of a Pokémon; accepts both ndex and name
p.forPokeTypes = function(frame)
local args = w.trimAll(frame.args)
local poke = formlib.nameToDataindex(mw.text.decode(args[1]))
local gen = args.gen or ''
 
local type1 = pdmultigen.getType1{args={getGenValue(pokes[poke].type1, gen = gen}})
local type2 = pdmultigen.getType2{args={getGenValue(pokes[poke].type2, gen = gen}})
 
return p.forModGradBg{args={forModGradBgLua(type1, type2}})
end
 
79 548

contributi

Menu di navigazione