Modulo:Partiti: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
151 cp (discussione | contributi)
mNessun oggetto della modifica
151 cp (discussione | contributi)
non più necessario
Etichetta: Annullato
Riga 24:
local x2 = mw.ustring.find(b,'%|')
local x3 = mw.ustring.find(b,'%]%]')
local x4 = mw.ustring.find(b,'%<%')
if (x4) then
a = mw.ustring.sub(a,x1+2,x4+x1)
end
if (x3) then
if (x2) then
Line 117 ⟶ 121:
cls[3] = 255 - math.floor((255-cls[3])*opac)
return string.format('&#35;%02x%02x%02x',cls[1],cls[2],cls[3])
end
 
-- ==========================================================
-- Converte codice hex in rgb percentuale
-- ==========================================================
local function codice(frame)
local args = getArgs(frame, {frameOnly = true})
local col = _colore(args[1], args[2])
local rgb = col:sub(6)
return (rgb:sub(1,6))
end
 
local function cod(frame)
local args = getArgs(frame, {frameOnly = true})
local col = _colore(args[1], args[2])
local rgb = col:sub(6)
local cls = {}
if (rgb:len() == 6) then
cls[1] = tonumber(rgb:sub(1,2),16) or 255
cls[2] = tonumber(rgb:sub(3,4),16) or 255
cls[3] = tonumber(rgb:sub(5,6),16) or 255
end
cls[1] = math.floor(cls[1]/255)
cls[2] = math.floor(cls[2]/255)
cls[3] = math.floor(cls[3]/255)
return string.format('%02x%02x%02x',cls[1],cls[2],cls[3])
end
 
Line 210 ⟶ 188:
color_table = color_table,
colore_ombra = colore_ombra,
sfondo = sfondo,
codice = codice,
cod = cod
}