Module:Episode table: Difference between revisions

Created page with "-- This module implements {{Episode table}} and {{Episode table/part}}. local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' ) -------------------------------------..."
m (1 revision imported)
en>Centrist16
(Created page with "-- This module implements {{Episode table}} and {{Episode table/part}}. local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' ) -------------------------------------...")
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)
Anonymous user