Module:TeamTotoSandbox: Difference between revisions

Created page with "local p = {} local luatable = require'Module:Color' local textutil = require'Module:Text Utility' local process_args = require'Module:ProcessArgs' local shaders = require'Module:ColorParse/Templates' local stringbyte, stringchar = string.byte, string.char local shader_to_class = { ['y'] = 'y-dark', ['Y'] = 'y', ['b'] = 'b-dark', ['B'] = 'b', ['c'] = 'c-dark', ['C'] = 'c', ['r'] = 'r-dark', ['R'] = 'r', ['o'] = 'o-dark', ['O'] = 'o', ['w'] = 'w-dark', ['W'] =..."
 
mNo edit summary
Line 193: Line 193:
     return table.concat(finaltbl)
     return table.concat(finaltbl)
end
end


function p.shadermain(frame)
function p.shadermain(frame)
Line 212: Line 211:


function applytemplate(shader, text, raster)
function applytemplate(shader, text, raster)
   if shaders[shader] == nil then
   class = shader_to_class[shader]
      error('There was no shader called ' .. (shader or '') .. '!')
  if class ~= nil then
  else
  shader = class
      return p.shader(text, shaders[shader][1], shaders[shader][2], raster)
   end
   end
  return '<span class=\"qud-text ' .. shader .. '\">' .. text .. '</span>'
end
end