• Welcome to Touhou Wiki!
  • Registering is temporarily disabled. Check in our Discord server to request an account and for assistance of any kind.

Module:Styles

From Touhou Wiki
Revision as of 09:48, 9 February 2013 by DennouNeko (talk | contribs) (making sure that "isset" is defined...)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Styles/doc

-- Library containing global coloring and styling used by multiple scripts

-- dependencies
require("Module:Common")

-- create global object
if style == nil then style = {} end

-- naming based on "Navbox" elements
style.main_colors = {
  game = {title = '#FFC9C2', above = '#FFD1CA', group = '#FFD9D2', subgroup = '#FFE1DA', dark = '#FFEEE8', background = '#FFF4EE'};
  music = {title = '#FFF3B4', above = '#FFF6C0', group = '#FFF7C8', subgroup = '#FFF8D0', dark = '#FFFBE4', background = '#FFFBEE'};
  printwork = {title = '#DDE6FF', above = '#E1E7FF', group = '#E6E9FF', subgroup = '#EAECFF', dark = '#EDF2FF', background = '#F4F9FF'}
}

-- function for easy adding of styles to html tags
function addstyle(tbl, val)
  if isset(val) then
    local av = string.trim(val)
    if string.sub(av, -1) ~= ';' then av = av .. ';' end
    tbl[#tbl+1] = av
  end
end

-- [[Category:Lua Libraries|{{PAGENAME}}]]