Anonimo

Modulo:FunzioniGeneriche: differenze tra le versioni

Da Wikitrek.
nessun oggetto della modifica
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 100: Riga 100:
-- @return name of the color
-- @return name of the color
function p.TextColor(frame)
function p.TextColor(frame)
local hex = string.sub(frame.args[1], 1)
local hex = string.sub(frame.args[1], 2)
local R, G, B
local R, G, B
     if hex:len() == 3 then
     if hex:len() == 3 then
Riga 108: Riga 108:
       B = tonumber("0x"..hex:sub(3,3))*17/255
       B = tonumber("0x"..hex:sub(3,3))*17/255
     else
     else
     return (mw.text.nowiki(hex))
     --return (mw.text.nowiki(hex))
      --R = tonumber("0x"..hex:sub(1,2))/255
    R = tonumber("0x"..hex:sub(1,2))/255
    return (R)
       --G = tonumber("0x"..hex:sub(3,4))/255
       --G = tonumber("0x"..hex:sub(3,4))/255
       --B = tonumber("0x"..hex:sub(5,6))/255
       --B = tonumber("0x"..hex:sub(5,6))/255