You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  6. <meta name="Description" content="tiny ColorPicker is a small (10.0KB, 4.5KB gZip) but very advanced jQuery color picker and color conversion / calculation tool that supports the following color spaces: rgb, hsv, hsl, hex, but also alpha, WCAG 2.0 readability standards (based on opacity levels of all layers), contrast, color similarity, grayscale, 2-layer or 3-layer overlap mix, etc..." />
  7. <meta name="Keywords" content="ColorPicker, color picker, color chooser, color, picker, javaScript, jquery, colors, rgb, hsv, hsl, hex, alpha, WCAG 2.0, grayscale, contrast, readability, realtime, retina, high resolution" />
  8. <meta name="author" content="Peter Dematté" />
  9. <meta http-equiv="language" content="en" />
  10. <link rel="stylesheet" type="text/css" href="index.css">
  11. <link rel="shortcut icon" type="image/x-icon" href="development/favicon.ico">
  12. <link rel="icon" type="image/x-icon" href="development/favicon.ico">
  13. <!-- <link rel="stylesheet" type="text/css" href="development/colorPicker.css"> -->
  14. <link rel="stylesheet" type="text/css" href="development/compatibility.css">
  15. <!-- <script type="text/javascript" src="jquery-1.11.2.js"></script> -->
  16. <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
  17. <script type="text/javascript" src="colors.js"></script>
  18. <script type="text/javascript" src="jqColorPicker.js"></script>
  19. <!-- <script type="text/javascript" src="jqColorPicker.min.js"></script> -->
  20. <title>tiny jQuery color picker</title>
  21. </head>
  22. <body>
  23. <div id="content-wrapper">
  24. <h1>Tiny jQuery colorPicker</h1>
  25. <p>Looking for mobile first, tiny foot print, fast, scaleable, flexible and pluggable...<br>
  26. This <strong>5.07KB</strong> (gZip; 11.39KB minified) small HSB color picker is based on a subset of <a href="https://github.com/PitPik/colorPicker/blob/master/colors.js">colors.js</a> from it's big brother <a href="http://dematte.at/colorPicker/">colorPicker</a>, supports all modern features like touch and MS pointer, GPU accelerated rendering, battery friendly requestAnimationFrame and provides a lot of hooks for developers to write plugins (See demo plugins below in <a href="#demo">Demo</a>).</p>
  27. <a name="demo" id="demo" class="a-inline"></a>
  28. <h2>Demo</h2>
  29. On all elements with className 'color': <pre>$('.color').colorPicker();</pre>
  30. <p>Switch between plugins:
  31. <select id="pluginSelect">
  32. <option value="desktop">Desktop (no plugin)</option>
  33. <option value="mobile">Mobile</option>
  34. <option value="input">Input fields</option>
  35. <option value="memory">Color memory spaces</option>
  36. <option value="skinned">Skinned (white)</option>
  37. <option value="skinned_sa">Skinned, selective alpha</option>
  38. <option value="dev_skinned">Skinned dev-tools like</option>
  39. <option value="dev_skinned_rgb">Skinned, RGB sliders</option>
  40. <option value="dev_skinned_hh">Skinned dev-tools 3:2</option>
  41. <option value="noalpha">Default without alpha</option>
  42. <option value="small">Default but smaller</option>
  43. <option value="IE8">Better IE8- support</option>
  44. </select>
  45. (see index.html for more details...)
  46. </p>
  47. <div class="input-toggles">
  48. <input class="color no-alpha" value="#B6BD79" />
  49. <input class="color no-alpha" value="rgb(162, 63, 3)" />
  50. <input class="color no-alpha" value="hsl(32, 95%, 23%)" />
  51. </div>
  52. <div class="div-toggles">
  53. <div class="trigger" value="#556B2F"><div><div></div></div></div>
  54. <div class="trigger" value="rgb(100, 86, 70)"><div><div></div></div></div>
  55. <div class="trigger" value="hsla(167, 29%, 68%, 0.8)"><div><div></div></div></div>
  56. <img id="qr" style="float: right; display: block; display: none; margin-right: -200px;" src="./development/qr.png" alt="QR code for http://www.dematte.at/tinyColorPicker/?type=mobile#demo">
  57. </div>
  58. <h2>Usage</h2>
  59. <p>There is only one file you need to load... No images and no CSS required.</p>
  60. <pre style="display: block; overflow: auto;">
  61. &lt;script type="text/javascript" src="jqColorPicker.min.js">
  62. &lt;script type="text/javascript">
  63. $('.color').colorPicker(); // that's it
  64. &lt;/script>
  65. </pre>
  66. <h2>Features</h2>
  67. <p>Tiny jQuery colorPicker only loads into memory if triggered to show and auto repositiones inside view-port if it doesn't fit. It uses battery saving technologies, super fast rendering for best performance on desktop and mobile browsers and renders perfectly smooth on retina and high resolution displays.<br>
  68. This colorPicker is very flexible to modify and customize and there is an easy way to write plugins to extend functionality, look and feel...<br>
  69. As Tiny jQuery colorPicker uses <a href="https://github.com/PitPik/colorPicker/blob/master/colors.js">colors.js</a> from it's big brother <a href="http://dematte.at/colorPicker/">colorPicker</a>, it provides a clean and rich color model and API that enables flexible extending for programmers. (See <a href="https://github.com/PitPik/colorPicker">colorPicker on GitHub</a> for more details)</p>
  70. <p>The following snipped shows how easy it is to make plugins: use for mobile</p>
  71. <pre style="display: block; overflow: auto;">
  72. window.myColorPicker = $('input.color').colorPicker({
  73. buildCallback: function($elm) {
  74. this.$colorPatch = $elm.prepend('&lt;div class="cp-disp">').find('.cp-disp');
  75. },
  76. cssAddon:
  77. '.cp-disp {padding:10px; margin-bottom:6px; font-size:19px; height:20px; line-height:20px}' +
  78. '.cp-xy-slider {width:200px; height:200px;}' +
  79. '.cp-xy-cursor {width:16px; height:16px; border-width:2px; margin:-8px}' +
  80. '.cp-z-slider {height:200px; width:40px;}' +
  81. '.cp-z-cursor {border-width:8px; margin-top:-8px;}' +
  82. '.cp-alpha {height:40px;}' +
  83. '.cp-alpha-cursor {border-width:8px; margin-left:-8px;}',
  84. renderCallback: function($elm, toggled) {
  85. var colors = this.color.colors;
  86. this.$colorPatch.css({
  87. backgroundColor: '#' + colors.HEX,
  88. color: colors.RGBLuminance > 0.22 ? '#222' : '#ddd'
  89. }).text(this.color.toString($elm._colorMode)); // $elm.val();
  90. }
  91. });
  92. </pre>
  93. <h2>API and usage</h2>
  94. <p>Will follow... See <a href="https://github.com/PitPik/tinyColorPicker">tinyColorPicker on GitHub</a> for now.</p>
  95. </div>
  96. <a class="a-inline" href="https://github.com/PitPik/tinyColorPicker"><img style="position: absolute; top: 0; right: 0; border: 0;" src="development/fmog.png" alt="Fork me on GitHub"></a>
  97. <script type="text/javascript" src="index.js"></script>
  98. </body>
  99. </html>