Commits

Matt Ryall committed 06a38a7

Better docs

Comments (0)

Files changed (1)

 ### JSColor -- a small colour utilities library in JavaScript
 
-There are currently just two methods in this library:
+This library contains functions to convert between different colour schemes in JavaScript. This might be useful for dynamic colour schemes or animation.
 
-* Color.rgb_to_hsl(red, green, blue)
+#### Usage
 
-* Color.hsl_to_rgb(hue, saturation, brightness)
+Include color-converter.js in your page. All the functions are available on the Color global object.
 
+#### Functions
+
+##### Color.rgb_to_hsl(red, green, blue)
+
+Converts an RGB colour to HSL (hue/saturation/lightness). The input values must be in the range 0-255, the output values will be in the ranges 0-360 (hue) and 0-100 (saturation, lightness).
+
+The algorithm used for conversion is taken from the CSS 3 specification.
+
+##### Color.hsl_to_rgb(hue, saturation, brightness)
+
+Converts an HSL colour to RGB. The input values must be in the ranges 0-360 (hue) and 0-100 (saturation, lightness), the output values will be in the range 0-255.
+
+##### Color.to_hex(red, green, blue)
+
+Converts RGB colour values into a CSS hex colour. For example, `Color.to_hex(255, 255, 255)` will produce "#ffffff".
+
+#### License
+
+This library is licensed under the Apache License v2.0. See LICENSE.txt for more information.
+