Module:Episode table: Difference between revisions

m
1 revision imported
m (1 revision imported)
m (1 revision imported)
 
(One intermediate revision by one other user not shown)
Line 56:
local row = mw.html.create('tr')
local black_cr = contrast_ratio{args.c[2], 'black', ['error'] = 0}
local white_cr = contrast_ratio{'white', args.c[2], ['error'] = 0}
local displaytext = (not args.nopart and 'Part ' or '') .. (args.p[1] or '')
row:tag('td')
:attr('colspan',13)
:css('text-align','center')
:css('background-color', args.c[2])
:css('color', black_cr > white_cr and 'black' or 'white')
:wikitext("'''" .. frame:expandTemplate({title='Visible anchor',args={displaytext}}) .. "'''" .. (args.r and " " .. EpisodeTable.reference(args.r, args.c) or ''))
return tostring(row)