Global Lua Modules/Colors

Colors is a library for embedded color processing in the FANDOM environment. It ports and extends functionality from the Colors JavaScript library from Pecoes.

Features

 * Color parameter support in Lua modules
 * Color parameter insertion in wiki templates
 * Color variable parsing for templating inline styles
 * Color item creation and conversion utilities
 * A vast array of color processing methods
 * Alpha and boolean support for flexible color logic

How to install
There are two components you can install:

Module
The module itself can be invoked globally with the following code:

Template
Add the Colors template to your wiki for frequent usage.

Package members and methods
The following keys are exposed in the module package:
 * - template utility for accessing CSS colors
 * - template utility for FANDOM CSS $parameter support
 * - color item creation from RGB tuple
 * - color item creation from HSL tuple
 * - color parsing of any valid CSS color string
 * - table of FANDOM SASS colors for Lua modules

Example usage on a wiki
Rendered output on desktop:

Property getter-setter methods
These methods retrieve or override color properties. They accept a optional value parameter.
 * - red color value (1-255)
 * - hue color value (0-1)
 * - saturation color value (0-1)
 * * - color rotation by degree
 * * - color saturation change by modifier
 * * - color lightness change by modifier
 * * - color alpha change by modifier
 * - mixing with other color items or strings (scaled by 100, in reverse)
 * - inversion of color item
 * - complement of color item

Output methods
These methods return a valid CSS color string.
 * - hexadecimal RGB string output
 * - RGB(A) functional string output
 * - HSL(A) functional string output
 * - hexadecimal or HSLA string string output ( / )

Conditionals for color logic
These methods return a boolean for use in Lua logic.
 * - brightness status for color item (accepts optional 1-100 limit parameter)
 * - color saturation and visibility status for color item


 * N.B:** to test whether something is a color item or string, use.