Colors

This is a library for handling colors in the Wikia environment. At the moment it is still a bit simple but it does feature most of what you need to adapt your addon(s) to the varying color schemes across Wikia.

dev.colors.brighten
parameters:


 * 1) color (string)
 * 2) offset (float)

returns color (string)

changes the luminosity of a color provided as a string in RGB format - either in hex or in rgb notation. Offset must lie between -1 and 1. Negative offsets darken. Positive offsets brighten.

dev.colors.isBright
parameters:


 * 1) color (string)

returns boolean

determines whether a color is bright or dark. Color must be provided as a string - either in hex or in rgb notation.

dev.colors.replace
parameters:


 * 1) stylesheet (string)

returns modified stylesheet

accepts a series of CSS rules in string format and replaces a number of pseudo-color with the ones that are in use on the current page

Example:

dev.colors.body
pseudo-color: $body

color of background that surrounds the content area. On this page:



dev.colors.page
pseudo-color: $page

color of article background. On this page:



dev.colors.menu
pseudo-color: $menu

color of menu and button elements. On this page:



dev.colors.wikia
pseudo-color: $wikia

color of the Wikia header at the top of the page. On this page:



dev.colors.link
pseudo-color: $link

color of links. On this page:



dev.colors.contrast
pseudo-color: $contrast

color that contrasts with the menu and button color - either white or black. On this page:



dev.colors.text
pseudo-color: $text

color of text in the main article area. On this page:



dev.colors.border
pseudo-color: $border

color of border, frame and separator elements. On this page:



dev.colors.gradient
pseudo-color: $gradient

secondary (bright) color of button elements. Use this to create a gradient with $menu. On this page:

