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.
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)
- http://easyrgb.com
- http://www.aprompt.ca/WebPageColors.html
- http://www.fx.clemson.edu/~rkarl/c2g.html
- http://mckoss.com/jscript/object.htm
Mike Koss has a pretty interesting approach at ‘class’ inheritance that he explains here: http://mckoss.com/jscript/object.htm
- Version: 0.4
copyright © 2008 Francois Lafortune ( aka: QuickRedFox )
This code is freely distributable under the terms of the GNU GENERAL PUBLIC LICENSE Version 3
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)
| 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. |
A JsGouache.Color Object
- JsGouache.RGBColor
- JsGouache.HexColor
- JsGouache.HSLColor
Creates a JsGouache.RGBColor Object
| 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. |
A JsGouache.RGBColor Object
- JsGouache.HexColor
- JsGouache.HSLColor
Creates a JsGouache.HexColor Object
| 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. |
A JsGouache.HexColor Object
- JsGouache.RGBColor
- JsGouache.HSLColor
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.
| what | (String or Integer) One of either: 0 or ‘protanopia’, 1 or ‘deuteranopia’, 2 or ‘tritanopia’, 3 or ‘achromatopsia’ |
JsGouache.Color Object
Get the readability factor of two colors (foreground and background) According to current W3C Standards
| clr1 | (JsGouache.Color) |
| clr2 | (JsGouache.Color) |
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)