From ea0b438ab5de62ac199c5f78dc3d5c4cdd169a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Dematt=C3=A9?= Date: Wed, 6 Aug 2014 17:40:57 +0200 Subject: [PATCH] Update README.md --- README.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 24faced..4e14629 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -colorPicker -=========== +# colorPicker -An advanced, fast and small javaScript color picker (color chooser for desktop use) using colors.js, a small but comprehensive tool for color conversions / calculations... that uses only one .js file (no extra HTML, CSS, images, etc... on IE9+ and internet browsers), works though in all browsers and also on IE6+ (an extra CSS has to be made to make it work in IE6 though and some additional setTimeout tricks to make it work in IE5.5) +An advanced, fast but small **javaScript (only) color picker** (color chooser for desktop use) that uses only one .js file (no extra HTML, CSS, images, etc... on IE9+ and internet browsers), works though in all browsers incl. IE6+ (an extra CSS has to be made to make it work in IE6 though and some additional setTimeout tricks to make it work in IE5.5)
+colorPicker uses colors.js, a small but comprehensive tool for color conversions / calculations... -With Colors.js (~8.7k or way smaller if other color spaces and complex calculations are taken out...) you can also make simpler and / or smaller color pickers quite easy as demonstrated on the demo page. +With **Colors.js** (~8.7k or way smaller if other color spaces and complex calculations are taken out...) you can also build your own simpler and / or smaller color pickers quite easy as demonstrated on the demo page.
+**Colors.js** can convert 182 different combinations of color spaces (rgb2HSV, RGB2hsl, rgb2RGB, HEX2Lab, ...) -See demo at http://dematte.at/cpn +##Demo +See **demo** at http://dematte.at/cpn -All the W3C 2.0 calculations for readability are also based on opacity levels on all layers
-Supported color spaces: (*: also displayed as colors)
+All the W3C 2.0 calculations for readability are also based on opacity levels of all layers
+Supported color spaces are: (* also displayed as colors in realtime)
rgb *, hsv(b) *, hsl *, cmyk, cmy, Lab, XYZ, HEX -Convertions of 182 color space combinations (rgb2HSV, RGB2hsl, rgb2RGB, HEX2Lab, ...) - -
+```javascript
 var myColors = new Colors({ // all options have a default value...
     color: 'rgba(204, 82, 37, 0.8)', // initial color (#RGB, RGB, #RRGGBB, RRGGBB, rgb(r, g, b), ...)
     XYZMatrix: ..., // Observer = 2° (CIE 1931), Illuminant = D65  --- see source for dedtails
@@ -27,9 +27,11 @@ var myColors = new Colors({ // all options have a default value...
     convertCallback: function(colors, type){}, // callback function after color convertion for further calculations...
     allMixDetails: false // if set to true, Colors deliveres some more mixed layer informations for all color layers
 });
+```
 
 colorPicker uses an instance of Colors and passes the options to it, so some values are the same...
 
+```javascript
 var myColorPicker = new ColorPicker({
     color: ..., // see Colors...
     mode: 'rgb-b', // initial mode the color picker is starting with
@@ -63,9 +65,11 @@ var myColorPicker = new ColorPicker({
     actionCallback: function(e, action){}, // callback on any action within colorPicker (buttons, sliders, ...)
     convertCallback: function(colors, type){}, // see Colors...
 });
+```
 
 After initializing Color or ColorPicker you'll get a clean but rhich model of the instance:
 
+```javascript
 Color: {
     colors: {all kinds of color values...},
     options: {all the options you set or that are set as default...},
@@ -77,7 +81,9 @@ Color: {
         convertColor: function(color, type) {} // converts 182 different combinations
     }
 }
+```
 
+```javascript
 ColorPicker: {
     color: { // instance of Color inside colorPicker
         colors: {all kinds of color values...},
@@ -94,12 +100,14 @@ ColorPicker: {
         destroyAll: function() {}
     }
 }
+```
 
 The klass ColorPicker has some functions attached, used inside, exported for convenience...
 
+```javascript
 ColorPicker.addEvent = function(obj, type, func){}; // with built in cashe
 ColorPicker.removeEvent = function(obj, type, func){};
 ColorPicker.getOrigin = function(elm){};
 ColorPicker.limitValue = function(value, min, max){};
 ColorPicker.changeClass = function(elm, cln, newCln){}; // a bit tricky to use...
-
+```