8,756
edits
mNo edit summary |
mNo edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
function p.parse(frame) | function p.parse(frame) | ||
local a = string.gsub(frame.args[1],"( | local a = string.gsub(frame.args[1],"([012345678ABCD])", function(bit) | ||
local luatable = { | local luatable = { | ||
['0'] = "#98875f", | |||
['1'] = "#a64a2e", | ['1'] = "#a64a2e", | ||
['A'] = "#d74200", | ['A'] = "#d74200", | ||
Line 15: | Line 16: | ||
['6'] = "#cfc041", | ['6'] = "#cfc041", | ||
['5'] = "#155352", | ['5'] = "#155352", | ||
['7'] = "# | ['7'] = "#ffffff", | ||
} | } | ||
local result= luatable[bit] | |||
return "<span style=\"color: " .. | if result == nil then | ||
result='white' | |||
end | |||
return "<span style=\"color: " .. result .. ";\">" .. bit .. "</span>" | |||
end) | end) | ||
return a | return a | ||
end | end | ||
return p |