JsGouache.js
JsGouache aims to offer a tool for javascript developers to manipulate colors within various color spaces while raising awareness for different types of color deficiencies.
About
JsGouache aims to offer a tool for javascript developers to manipulate colors within various color spaces while attempting to raise awareness for different types of color deficiencies.
The library offers various functions for manipulation of the more common color spaces used on the web: RGB, Hexadecimal, HSL. It also implements a theoretical (limited) simulation of the LMS color space (http://en.wikipedia.org/wiki/LMS_Color_Space)
References
- http://easyrgb.com
- http://www.aprompt.ca/WebPageColors.html
- http://www.fx.clemson.edu/~rkarl/c2g.html
- http://mckoss.com/jscript/object.htm
Note
Mike Koss has a pretty interesting approach at ‘class’ inheritance that he explains here: http://mckoss.com/jscript/object.htm
Version
- Version: 0.4
Requirements
- Javascript: http://en.wikipedia.org/wiki/JavaScript
Copyright
copyright © 2008 Francois Lafortune ( aka: QuickRedFox )
License
This code is freely distributable under the terms of the GNU GENERAL PUBLIC LICENSE Version 3
The JsGouache color object (constructor)
Constructor
The JsGouache.Color construct creates the main color object which can then be used within the various color spaces. It is suggested though, that you use the proper constructs for the desired spaces. (RGBColor, HexColor, HSLColor)
Parameters
colorRepresentation | (Mixed) Either 3 arguments for and RGB triple or the Hexadecimal representation of a color or even a css-style string format representations or and rgb triple. |
Returns
A JsGouache.Color Object
See Also
- JsGouache.RGBColor
- JsGouache.HexColor
- JsGouache.HSLColor
The RGB color object (constructor)
Constructor
Creates a JsGouache.RGBColor Object
Parameters
colorRepresentation | (Mixed) Either 3 arguments for and RGB triple or the Hexadecimal representation of a color or even a css-style string format representations or and rgb triple. |
Returns
A JsGouache.RGBColor Object
See Also
- JsGouache.HexColor
- JsGouache.HSLColor
The Hexadecimal color object (constructor)
Constructor
Creates a JsGouache.HexColor Object
Parameters
colorRepresentation | (Mixed) Either 3 arguments for and RGB triple or the Hexadecimal representation of a color or even a css-style string format representations or and rgb triple. |
Returns
A JsGouache.HexColor Object
See Also
- JsGouache.RGBColor
- JsGouache.HSLColor
JsGouache. Color. simulate
Color perception disability simulations. Most of this is based on code from http://www.fx.clemson.edu/~rkarl/c2g.html Which in turn, is based on the H. Brettel, F. Vienot and J. Mollon Algorithm.
Parameters
what | (String or Integer) One of either: 0 or ‘protanopia’, 1 or ‘deuteranopia’, 2 or ‘tritanopia’, 3 or ‘achromatopsia’ |
Returns
JsGouache.Color Object
JsGouache. ColorAccessible. readability
Get the readability factor of two colors (foreground and background) According to current W3C Standards
Parameters
clr1 | (JsGouache.Color) |
clr2 | (JsGouache.Color) |
Returns
Object containing the perceived hue contrast and perceived brightness contrast for the supplied colors for each type of deficiency. (The more trusted one being hue contrast)