Module:Bicolor/data2
Jump to navigation
Jump to search
CodeDiscussionEditHistoryLinksLink count Subpages:DocumentationTestsResultsSandboxLive code All modules
Lua
Documentation for this module may be created at Module:Bicolor/data2/doc
Code
--[[
Bicolor module to contain colours for Module:Bicolor
We can load this efficiently with
local c = mw.loadData( "Module:Bicolor/data" )
local colors = c.colors
local combinations = c.combinations
Creatng the definitions like this offers us tables indexed by number or by colour name
and combinations as a sequence or an indexed set for efficient testing
--]]
local p = {}
-- existing combinations as a sequence
-- will be used as combinations[n]
-- insert new combinations here, preferably in alphabetical order
local combinations = {
"amber beige",
"amber black",
"amber blue",
"amber brown",
"amber coral",
"amber cream",
"amber crimson",
"amber cyan",
"amber gold",
"amber golden",
"amber gray",
"amber green",
"amber grey",
"amber hazel",
"amber lilac",
"amber magenta",
"amber maroon",
"amber mauve",
"amber olive",
"amber orange",
"amber pink",
"amber purple",
"amber red",
"amber salmon",
"amber silver",
"amber teal",
"amber turquoise",
"amber vermilion",
"amber violet",
"amber white",
"amber yellow",
"beige black",
"beige blue",
"beige brown",
"beige coral",
"beige cream",
"beige crimson",
"beige cyan",
"beige gold",
"beige golden",
"beige gray",
"beige green",
"beige grey",
"beige hazel",
"beige lilac",
"beige magenta",
"beige maroon",
"beige mauve",
"beige olive",
"beige orange",
"beige pink",
"beige purple",
"beige red",
"beige salmon",
"beige silver",
"beige teal",
"beige turquoise",
"beige vermilion",
"beige violet",
"beige white",
"beige yellow",
"black blond",
"black blue",
"black brown",
"black coral",
"black cream",
"black crimson",
"black cyan",
"black gold",
"black golden",
"black gray",
"black green",
"black grey",
"black hazel",
"black lilac",
"black magenta",
"black maroon",
"black mauve",
"black olive",
"black orange",
"black pink",
"black purple",
"black red",
"black salmon",
"black silver",
"black teal",
"black turquoise",
"black vermilion",
"black violet",
"black white",
"black yellow",
"blond brown",
"blue brown",
"blue coral",
"blue cream",
"blue crimson",
"blue cyan",
"blue gold",
"blue golden",
"blue gray",
"blue green",
"blue grey",
"blue hazel",
"blue lilac",
"blue magenta",
"blue maroon",
"blue mauve",
"blue navy",
"blue olive",
"blue orange",
"blue pink",
"blue purple",
"blue red",
"blue salmon",
"blue silver",
"blue tan",
"blue teal",
"blue turquoise",
"blue vermilion",
"blue violet",
"blue white",
"blue yellow",
"brown coral",
"brown cream",
"brown crimson",
"brown cyan",
"brown gold",
"brown golden",
"brown gray",
"brown green",
"brown grey",
"brown hazel",
"brown lilac",
"brown magenta",
"brown maroon",
"brown mauve",
"brown olive",
"brown orange",
"brown pink",
"brown purple",
"brown red",
"brown salmon",
"brown silver",
"brown teal",
"brown turquoise",
"brown vermilion",
"brown violet",
"brown white",
"brown yellow",
"coral cream",
"coral crimson",
"coral cyan",
"coral gold",
"coral golden",
"coral gray",
"coral green",
"coral grey",
"coral hazel",
"coral lilac",
"coral magenta",
"coral maroon",
"coral mauve",
"coral olive",
"coral orange",
"coral pink",
"coral purple",
"coral red",
"coral salmon",
"coral silver",
"coral teal",
"coral turquoise",
"coral vermilion",
"coral violet",
"coral white",
"coral yellow",
"cream crimson",
"cream cyan",
"cream gold",
"cream golden",
"cream gray",
"cream green",
"cream grey",
"cream hazel",
"cream lilac",
"cream magenta",
"cream maroon",
"cream mauve",
"cream olive",
"cream orange",
"cream pink",
"cream purple",
"cream red",
"cream salmon",
"cream silver",
"cream teal",
"cream turquoise",
"cream vermilion",
"cream violet",
"cream white",
"cream yellow",
"crimson cyan",
"crimson gold",
"crimson golden",
"crimson gray",
"crimson green",
"crimson grey",
"crimson hazel",
"crimson lilac",
"crimson magenta",
"crimson maroon",
"crimson mauve",
"crimson olive",
"crimson orange",
"crimson pink",
"crimson purple",
"crimson red",
"crimson salmon",
"crimson silver",
"crimson teal",
"crimson turquoise",
"crimson vermilion",
"crimson violet",
"crimson white",
"crimson yellow",
"cyan gold",
"cyan golden",
"cyan gray",
"cyan green",
"cyan grey",
"cyan hazel",
"cyan lilac",
"cyan magenta",
"cyan maroon",
"cyan mauve",
"cyan olive",
"cyan orange",
"cyan pink",
"cyan purple",
"cyan red",
"cyan salmon",
"cyan silver",
"cyan teal",
"cyan turquoise",
"cyan vermilion",
"cyan violet",
"cyan white",
"cyan yellow",
"gold gray",
"gold green",
"gold grey",
"gold hazel",
"gold lilac",
"gold magenta",
"gold maroon",
"gold mauve",
"gold olive",
"gold orange",
"gold pink",
"gold purple",
"gold red",
"gold salmon",
"gold silver",
"gold teal",
"gold turquoise",
"gold vermilion",
"gold violet",
"gold white",
"gold yellow",
"golden gray",
"golden green",
"golden grey",
"golden hazel",
"golden lilac",
"golden magenta",
"golden maroon",
"golden mauve",
"golden olive",
"golden orange",
"golden pink",
"golden purple",
"golden red",
"golden salmon",
"golden silver",
"golden teal",
"golden turquoise",
"golden vermilion",
"golden violet",
"golden white",
"golden yellow",
"gray green",
"gray hazel",
"gray lilac",
"gray magenta",
"gray maroon",
"gray mauve",
"gray navy",
"gray olive",
"gray orange",
"gray pink",
"gray purple",
"gray red",
"gray salmon",
"gray silver",
"gray tan",
"gray teal",
"gray turquoise",
"gray vermilion",
"gray violet",
"gray white",
"gray yellow",
"green grey",
"green hazel",
"green lilac",
"green magenta",
"green maroon",
"green mauve",
"green olive",
"green orange",
"green pink",
"green purple",
"green red",
"green salmon",
"green silver",
"green tan",
"green teal",
"green turquoise",
"green vermilion",
"green violet",
"green white",
"green yellow",
"grey hazel",
"grey lilac",
"grey magenta",
"grey maroon",
"grey mauve",
"grey navy",
"grey olive",
"grey orange",
"grey pink",
"grey purple",
"grey red",
"grey salmon",
"grey silver",
"grey teal",
"grey turquoise",
"grey vermilion",
"grey violet",
"grey white",
"grey yellow",
"hazel lilac",
"hazel magenta",
"hazel maroon",
"hazel mauve",
"hazel olive",
"hazel orange",
"hazel pink",
"hazel purple",
"hazel red",
"hazel salmon",
"hazel silver",
"hazel teal",
"hazel turquoise",
"hazel vermilion",
"hazel violet",
"hazel white",
"hazel yellow",
"lilac magenta",
"lilac maroon",
"lilac mauve",
"lilac olive",
"lilac orange",
"lilac pink",
"lilac purple",
"lilac red",
"lilac salmon",
"lilac silver",
"lilac teal",
"lilac turquoise",
"lilac vermilion",
"lilac violet",
"lilac white",
"lilac yellow",
"magenta maroon",
"magenta mauve",
"magenta olive",
"magenta orange",
"magenta pink",
"magenta purple",
"magenta red",
"magenta salmon",
"magenta silver",
"magenta teal",
"magenta turquoise",
"magenta vermilion",
"magenta violet",
"magenta white",
"magenta yellow",
"maroon mauve",
"maroon navy",
"maroon olive",
"maroon orange",
"maroon pink",
"maroon purple",
"maroon red",
"maroon salmon",
"maroon silver",
"maroon teal",
"maroon turquoise",
"maroon vermilion",
"maroon violet",
"maroon white",
"maroon yellow",
"mauve olive",
"mauve orange",
"mauve pink",
"mauve purple",
"mauve red",
"mauve salmon",
"mauve silver",
"mauve teal",
"mauve turquoise",
"mauve vermilion",
"mauve violet",
"mauve white",
"mauve yellow",
"navy orange",
"navy red",
"navy white",
"navy yellow",
"olive orange",
"olive pink",
"olive purple",
"olive red",
"olive salmon",
"olive silver",
"olive teal",
"olive turquoise",
"olive vermilion",
"olive violet",
"olive white",
"olive yellow",
"orange pink",
"orange purple",
"orange red",
"orange salmon",
"orange silver",
"orange teal",
"orange turquoise",
"orange vermilion",
"orange violet",
"orange white",
"orange yellow",
"pink purple",
"pink red",
"pink salmon",
"pink silver",
"pink teal",
"pink turquoise",
"pink vermilion",
"pink violet",
"pink white",
"pink yellow",
"purple red",
"purple salmon",
"purple silver",
"purple teal",
"purple turquoise",
"purple vermilion",
"purple violet",
"purple white",
"purple yellow",
"red black",
"red salmon",
"red silver",
"red tan",
"red teal",
"red turquoise",
"red vermilion",
"red violet",
"red white",
"red yellow",
"salmon silver",
"salmon teal",
"salmon turquoise",
"salmon vermilion",
"salmon violet",
"salmon white",
"salmon yellow",
"silver teal",
"silver turquoise",
"silver vermilion",
"silver violet",
"silver white",
"silver yellow",
"tan yellow",
"teal turquoise",
"teal vermilion",
"teal violet",
"teal white",
"teal yellow",
"turquoise vermilion",
"turquoise violet",
"turquoise white",
"turquoise yellow",
"vermilion violet",
"vermilion white",
"vermilion yellow",
"violet white",
"violet yellow",
"white black",
"white blue",
"white green",
"white navy",
"white red",
"white yellow",
"yellow black",
"yellow blue",
"yellow green",
"yellow navy",
"yellow red",
}
-- colour definitions as a sequence of name and value
-- insert new colours here, preferably in alphabetical order
p.colors = {
amber = "#FFBF00",
beige = "#F5F5DC",
black = "black",
blue = "#2337F7",
brown = "#80583C",
coral = "#F5757F",
cream = "#FFFDD0",
crimson = "crimson",
cyan = "#53F1F1",
gold = "gold",
golden = "gold",
gray = "grey",
green = "#18A814",
grey = "grey",
hazel = "#5F6401",
lilac = "#DBBFF9",
magenta = "#E83BE8",
maroon = "maroon",
mauve = "#E0B0FF",
navy = "#000080",
olive = "olive",
orange = "orange",
pink = "pink",
purple = "#8A1799",
red = "red",
salmon = "salmon",
silver = "silver",
tan = "tan",
teal = "teal",
turquoise = "#28C6B5",
vermilion = "#E34234",
violet = "#6422D3",
white = "white",
yellow = "#F1F14B",
}
-- derive the indexed set of existing combinations from the sequence of combinations
-- so that combinationkeys["name-of-combination"] will be true id the combination exists
local combinationkeys = {}
for i, v in ipairs(combinations) do
combinationkeys[v] = true
end
p.combinations = combinationkeys
return p