卡厄思梦境WIKI
菜单
图鉴
战斗员
伙伴
卡牌
装备
事件
怪物
命运
物品
服饰
贴纸
赛季力量
S2:装备重铸
S3:刻印
出击
卡牌
装备
事件
怪物
命运
搜索
链入页面
相关更改
特殊页面
页面信息
Cargo数据
最近更改
帮助
登录
模块
查看“︁文本”︁的源代码
←
模块:文本
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} local colorMap = { ['红'] = '#ff4d4d', ['蓝'] = '#7be3fd', ['绿'] = '#a8f428', ['黄'] = '#ffe44d', ['橙'] = '#ed9703', ['粉'] = '#ffb3d9', ['灰'] = '#a0a0a0', ['热情'] = '#db3762', ['正义'] = '#2c8fd8', ['秩序'] = '#21bf80', ['本能'] = '#eda000', ['虚无'] = '#9900ff', } local function resolveColor(color) if not color or color == '' then return nil end if colorMap[color] then return colorMap[color] end local hex = color if string.sub(hex, 1, 1) ~= '#' then hex = '#' .. hex end if string.match(hex, '^#[0-9a-fA-F]{3}$') or string.match(hex, '^#[0-9a-fA-F]{6}$') then return hex end return color end function p.main(frame) local args = frame:getParent().args local color = args['颜色'] or '' local stroke = args['描边'] or '' local underline = args['下划线'] or '' local italic = args['斜体'] or '' local content = args[1] or '' local classes = { 'text-style' } local styles = {} local colorVal = resolveColor(color) if colorVal then table.insert(classes, 'text-style--colored') table.insert(styles, 'color: ' .. colorVal .. ';') end local strokeVal = resolveColor(stroke) if strokeVal then table.insert(classes, 'text-style--stroked') table.insert(styles, '-webkit-text-stroke: 1px ' .. strokeVal .. ';') table.insert(styles, 'paint-order: stroke fill;') if not colorVal then table.insert(styles, 'color: #fff;') end end if underline ~= '' then table.insert(classes, 'text-style--underline') end if italic ~= '' then table.insert(classes, 'text-style--italic') end local html = '<span class="' .. table.concat(classes, ' ') .. '"' if #styles > 0 then html = html .. ' style="' .. table.concat(styles, ' ') .. '"' end html = html .. '>' .. content .. '</span>' return html end return p
该页面使用的模板:
模块:文本/doc
(
查看源代码
)
返回
模块:文本
。