置顶公告:【置顶】关于临时开启评论区所有功能的公告(2022.10.22) | 【置顶】关于本站Widget恢复使用的公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

Module:交叉阴影

猛汉♂百科,万男皆可猛的百科全书!转载请标注来源页面的网页链接,并声明引自猛汉百科。内容不可商用。
跳到导航 跳到搜索
Template-info.svg 模块文档  [查看] [编辑] [历史] [刷新]

该模块实现{{交叉阴影}}的功能。

请不要直接调用此模块。

-- Module:交叉阴影
-- Made with ♥ by User:Leranjun

-- This module implements {{tl|交叉阴影}}.
-- Please refrain from invoking this module directly.

local p = {}

local getArgs = require("Module:Arguments").getArgs

function p.main(frame)
    return p._main(getArgs(frame), frame)
end

function p._main(args, frame)
    frame = frame or mw.getCurrentFrame()
    local colors = {
        [0] = {
            args.c2,
            args.s2
        },
        [1] = {
            args.c1,
            args.s1
        }
    }
    local r = ""
    local i = 1
    while (args[i]) do
        r =
            r ..
            frame:expandTemplate {
                title = "Font",
                args = {frame:preprocess(args[i]), color = colors[i % 2][1], shadowcolor = colors[i % 2][2]}
            }
        i = i + 1
    end

    return r
end

return p