Jump to content

Editing Module:ContestantColor

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 103: Line 103:
["Burgundy"]="800020",
["Burgundy"]="800020",
["Carmine"]="FF0040",
["Carmine"]="FF0040",
["Amaranth"]="E52B50",
["Amaranth"]="E52B50"
["Monochrome"]="linear-gradient(90deg,#000,#FFF)",
["Rainbow"]="linear-gradient(90deg,#F00,#FF0,#0F0,#0FF,#00F,#F0F,#F00)"
}
}
return (p.autoHex({args={f.args[1]}}) and (f.args[2]~=nil and f.args[2] or "#") or "")..(colors[p.nameMod(f.args[1]~=nil and f.args[1] or "")] or "000000")
return (f.args[2]~=nil and f.args[2] or "#")..(colors[p.nameMod(f.args[1]~=nil and f.args[1] or "")] or "000000")
end
end


function p.text(frame)
function p.text(frame)
local f=frame~=nil and frame or {args={}}
local f=frame~=nil and frame or {args={}}
local modif={ --1=black, 2=white with black outline, 3=black with white outline
local black={ --add contestants whose text colors should be black instead of white
["Silver"]=1,
["Silver"]=1,
["Platinum"]=1,
["Platinum"]=1,
Line 148: Line 146:
["Pink"]=1,
["Pink"]=1,
["Cerise"]=1,
["Cerise"]=1,
["Cotton Candy"]=1,
["Cotton Candy"]=1
["Rainbow"]=2
}
local res={
"#000",
"#FFF;text-shadow:-1px -1px 1px #000,1px -1px 1px #000,-1px 1px 1px #000,1px 1px 1px #000",
"#000;text-shadow:-1px -1px 1px #FFF,1px -1px 1px #FFF,-1px 1px 1px #FFF,1px 1px 1px #FFF"
}
}
return res[modif[p.nameMod(f.args[1]) or ""]] or "#FFF"
return (black[p.nameMod(f.args[1]~=nil and f.args[1] or "")]~=nil and "black" or "white")
end
 
function p.autoHex(frame)
local noHex={
["Monochrome"]=1,
["Rainbow"]=1
}
return noHex[p.nameMod(frame.args[1])]==nil
end
end


function p.nameMod(name)
function p.nameMod(name)
if name=="Grey" then name="Gray" end
if name=="Grey" then name="Gray" end
if name=="Mono" then name="Monochrome" end
return name
return name
end
end
return p
return p
Please note that all contributions to Keynotathlon Wiki are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (see Keynotathlon Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page:

Cookies help us deliver our services. By using our services, you agree to our use of cookies.