Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump version

  • Loading branch information...
commit ddcd4e4a37d9ef6b50b3916d78e9f2ef768b18c1 1 parent 96f87d0
Juho Vepsäläinen authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  dist/colorjoe.js
  2. +1 −1  dist/colorjoe.min.js
  3. +1 −1  grunt.js
2  dist/colorjoe.js
View
@@ -1,4 +1,4 @@
-/*! colorjoe - v0.3.0 - 2012-07-06
+/*! colorjoe - v0.3.5 - 2012-07-06
* http://bebraw.github.com/colorjoe/
* Copyright (c) 2012 Juho Vepsäläinen; Licensed MIT */
2  dist/colorjoe.min.js
View
@@ -1,4 +1,4 @@
-/*! colorjoe - v0.3.0 - 2012-07-06
+/*! colorjoe - v0.3.5 - 2012-07-06
* http://bebraw.github.com/colorjoe/
* Copyright (c) 2012 Juho Vepsäläinen; Licensed MIT */
(function(a,b){typeof define=="function"&&define.amd?define(b):a.drag=b()})(this,function(){function a(a,d){if(!a){console.warn("drag is missing elem!");return}b()?c(a,d,"touchstart","touchmove","touchend"):c(a,d,"mousedown","mousemove","mouseup")}function b(){return typeof window.ontouchstart!="undefined"}function c(a,b,c,g,h){var k=!1;b=f(b);var l=b.begin,m=b.change,n=b.end;d(a,c,function(b){function f(){k=!1,e(document,g,c),e(document,h,f),i(n,a,b)}k=!0;var c=j(i,m,a);d(document,g,c),d(document,h,f),i(l,a,b)}),d(a,h,function(b){k=!1,i(n,a,b)})}function d(a,b,c){a.addEventListener(b,c,!1)}function e(a,b,c){a.removeEventListener(b,c,!1)}function f(a){if(!a){var b,c;return{begin:function(a){b={x:a.elem.offsetLeft,y:a.elem.offsetTop},c=a.cursor},change:function(a){g(a.elem,"left",b.x+a.cursor.x-c.x+"px"),g(a.elem,"top",b.y+a.cursor.y-c.y+"px")},end:h}}return{begin:a.begin||h,change:a.change||h,end:a.end||h}}function g(a,b,c){a.style[b]=c}function h(){}function i(a,b,c){c.preventDefault();var d=k(b),e=b.clientWidth,f=b.clientHeight,g={x:l(b,c),y:m(b,c)},h=(g.x-d.x)/e,i=(g.y-d.y)/f;a({x:isNaN(h)?0:h,y:isNaN(i)?0:i,cursor:g,elem:b,e:c})}function j(a){var b=Array.prototype.slice,c=b.apply(arguments,[1]);return function(){return a.apply(null,c.concat(b.apply(arguments)))}}function k(a){var b=0,c=0;if(a.offsetParent)do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent);return{x:b,y:c}}function l(a,b){if(n(a)){var c=parseInt(document.defaultView.getComputedStyle(document.body,"").marginLeft,10);return b.clientX-c}if(b.pageX)return b.pageX;if(b.clientX)return b.clientX+document.body.scrollLeft}function m(a,b){if(n(a)){var c=parseInt(document.defaultView.getComputedStyle(document.body,"").marginTop,10);return b.clientY-c}if(b.pageY)return b.pageY;if(b.clientY)return b.clientY+document.body.scrollTop}function n(a){while(a.nodeName!="HTML"&&o(a,"position")!="fixed")a=a.parentNode;return a.nodeName=="HTML"?!1:!0}function o(a,b){var c;return window.getComputedStyle?c=window.getComputedStyle(a,null):c=a.currentStyle,c[b]}return a}),function(a,b){typeof exports=="object"?module.exports=b():typeof define=="function"&&define.amd?define(b):a.colorutils=b()}(this,function(){var a=function(a,b){b(a)},b=function(a){return Object.prototype.toString.call(a)==="[object Array]"},c=function(a){return Object.prototype.toString.call(a)==="[object Object]"},d=function(a){return typeof a=="string"},e=function(a,b){var c="",d=!0;return f(function(a){d?a!=b&&(d=!1,c+=a):c+=a},a),c},f=function(a,e){if(b(e)||d(e))for(var f=0,g=e.length;f<g;f++)a(e[f],f);if(c(e)){var h=0;for(var i in e)a(i,e[i],h),h++}},g=function(a,d){var e;if(b(d)){e=[];for(var f=0,g=d.length;f<g;f++)e.push(a(d[f],f))}if(c(d)){e={};var h=0;for(var i in d){var j=d[i];e[i]=a(i,j,h),h++}}return e},h=function(a,b){var d;if(c(b)){d={};var e=0;for(var f in b){var g=b[f];a(f,g,e)&&(d[f]=g),e++}}return d},i=function(a,b){var c={},d=function(a,b){c[a]=b};return f(d,a),f(d,b),c},j=function(a){var b={};return f(function(a){b[a[0]]=a[1]},a),b},k=function(a,b){var c=[];for(var d=0;d<a.length;d++)c.push([a[d],b[d]]);return c},l=function(a){var b=[];return f(function(a){b.push(a)},a),b},m=function(a){var b=[];return f(function(a,c){b.push(c)},a),b},n=function(a,b,c){return Math.min(Math.max(a,b),c)},o=function(a,b,c){return b-=a.toString().length,b>0?(new Array(b+(/\./.test(a)?2:1))).join(c)+a:a};return{context:a,isArray:b,isObject:c,isString:d,lstrip:e,each:f,map:g,filter:h,extend:i,toObject:j,zip:k,keys:l,values:m,clamp:n,leftFill:o}}),function(a,b){typeof exports=="object"?module.exports=b(require("./colorutils")):typeof define=="function"&&define.amd?define(["./colorutils"],b):a.color=b(a.colorutils)}(this,function(a){var b=function(a){var b={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};return a in b?b[a]:undefined},c=function(b){return b=a.lstrip(b,"#"),{r:parseInt(b.substring(0,2),16)/255||0,g:parseInt(b.substring(2,4),16)/255||0,b:parseInt(b.substring(4,6),16)/255||0}},d=function(a){return i(c(a))},e=function(a){return j(c(a))},f=function(a){var b,c,d,e=a.s,f=a.v,g=a.h;if(e>0){g>=1&&(g=0),g=6*g,F=g-Math.floor(g),A=f*(1-e),c=f*(1-e*F),C=f*(1-e*(1-F));switch(Math.floor(g)){case 0:b=f,d=C,c=A;break;case 1:b=c,d=f,c=A;break;case 2:b=A,d=f,c=C;break;case 3:b=A,d=c,c=f;break;case 4:b=C,d=A,c=f;break;case 5:b=f,d=A,c=c}return{r:b?b:0,g:d?d:0,b:c?c:0}}return{r:f,g:f,b:f}},g=function(a,b,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?a+(b-a)*6*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a},h=function(a){var b,c,d,e=a.h,f=a.s,h=a.l;if(f===0)b=c=d=h;else{var i=h<.5?h*(1+f):h+f-h*f,j=2*h-i;b=g(j,i,e+1/3),c=g(j,i,e),d=g(j,i,e-1/3)}return{r:b,g:c,b:d}},i=function(a){var b=a.r,c=a.g,d=a.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h,i=e,j=e-f;h=e===0?0:j/e;if(e==f)g=0;else{switch(e){case b:g=(c-d)/j+(c<d?6:0);break;case c:g=(d-b)/j+2;break;case d:g=(b-c)/j+4}g/=6}return{h:g,s:h,v:i}},j=function(a){var b=a.r,c=a.g,d=a.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h,i=(e+f)/2;if(e==f)g=h=0;else{var j=e-f;h=i>.5?j/(2-e-f):j/(e+f);switch(e){case b:g=(c-d)/j+(c<d?6:0);break;case c:g=(d-b)/j+2;break;case d:g=(b-c)/j+4}g/=6}return{h:g,s:h,l:i}},k=function(b){function c(b){return a.leftFill(Math.round(b*255).toString(16),2,0)}return c(b.r)+c(b.g)+c(b.b)},l=function(a){return k(f(a))},m=function(a){return k(h(a))},n=function(c,d){var e=function(e){if(a.isString(e)){var f=b(e);return f||(f=e),d.hexToColor(f)}if(a.isObject(e)){if("toHex"in e){var g=d.hexToColor(e.toHex());return g.a=e.a(),g}return a.filter(function(a){return a in c},e)}return null};return function(b){var f=a.extend(c,e(b));f=a.map(function(b,c){return a.clamp(c,0,1)},f);var g=function(b){return function(c){return c?(f[b]=a.clamp(c,0,1),h):f[b]}},h={toArray:function(){return a.values(f)},toCSS:function(){var a=d.colorToRGB(f),b=parseInt(a.r*255,10),c=parseInt(a.g*255,10),e=parseInt(a.b*255,10),g=f.a;return f.a<1?"rgba("+b+","+c+","+e+","+g+")":"rgb("+b+","+c+","+e+")"},toRGBA:function(){var a=d.colorToRGB(f);return a.a=f.a,a},toHex:function(){return d.colorToHex(f)}};return a.each(function(a){h[a]=g(a)},a.keys(f)),h}},o=n({r:0,g:0,b:0,a:1},{hexToColor:c,colorToRGB:function(a){return a},colorToHex:k}),p=n({h:0,s:0,v:0,a:1},{hexToColor:d,colorToRGB:f,colorToHex:l}),q=n({h:0,s:0,l:0,a:1},{hexToColor:e,colorToRGB:h,colorToHex:m});return{nameToHex:b,rgba:o,hsva:p,hsla:q}}),function(a,b){typeof define=="function"&&define.amd?define(["./color","./drag"],b):a.colorjoe=b(a.color,a.drag)}(this,function(a,b){function d(a,b,c){return Math.min(Math.max(a,b),c)}function e(a){return typeof a=="string"}function f(a,b,c){var d=document.createElement(a);return d.className=b,c.appendChild(d),d}function g(a){var b=Array.prototype.slice,c=b.apply(arguments,[1]);return function(){return a.apply(null,c.concat(b.apply(arguments)))}}var c=function(c,h){function j(c,e){function n(a){h.h(a.y),p(a.y),s(h)}function o(a){h.s(a.x),h.v(1-a.y),q(a.x,1-a.y),s(h)}function p(b){m.style.top=d(b*100,0,100)+"%",j.style.background=a.hsva({h:b,s:1,v:1}).toCSS()}function q(a,b){k.style.left=d(a*100,0,100)+"%",k.style.top=d((1-b)*100,0,100)+"%"}function s(){for(var a=0,b=r.change.length;a<b;a++)r.change[a](h)}function t(){for(var a=0,b=r.done.length;a<b;a++)r.done[a](h)}var h=a.hsva(e);c.className="colorPicker";var i=g(f,"div"),j=i("twod",c),k=i("pointer",j);i("shape shape1",k),i("shape shape2",k),i("bg bg1",j),i("bg bg2",j);var l=i("oned",c),m=i("pointer",l);i("shape",m),i("bg",l),b(l,{begin:n,change:n,end:t}),b(j,{begin:o,change:o,end:t}),p(h.h()),q(h.s(),h.v());var r={change:[],done:[]},u={e:c,update:function(){return s(h),u},get:function(){return a.rgba(h)},set:function(b){return h=a.hsva(b),h.v(h.v()),p(h.h()),q(h.s(),h.v()),u},on:function(a,b){return a=="change"||a=="done"?r[a].push(b):console.warn("Passed invalid evt name to colorjoe.on"),u},removeAllListeners:function(a){if(a)delete r[a];else for(var b in r)delete r[b]}};return u}var i=c;e(c)&&(i=document.getElementById(c));if(i)return j(i,h)};return c.partial=g,c.e=f,c}),function(a,b){typeof define=="function"&&define.amd?define(["./colorjoe","./color"],b):a.rgbjoe=b(a.colorjoe,a.color)}(this,function(a,b){return function(c,d){function n(a){var c=b.rgba({r:j.input.value/255,g:k.input.value/255,b:l.input.value/255});e.set(c);var d=e.get();m.input.value=d.toHex(),o(d)}function o(a){h.style.background=a.toCSS()}function p(a,b,c,d){var e=f(a,c),g=q(b,e),h=r("text",e,d);return{label:g,input:h}}function q(b,c){var d=a.e("label","",c);return d.innerHTML=b,d}function r(b,c,d){var e=a.e("input","",c);return e.type=b,d&&(e.maxLength=d),e}var e=a(c,d).on("change",function(a){o(a);var c=b.rgba(a);j.input.value=Math.round(c.r()*255),k.input.value=Math.round(c.g()*255),l.input.value=Math.round(c.b()*255),m.input.value=a.toHex()}),f=a.partial(a.e,"div"),g=f("extras",e.e),h=f("currentColor",g),i=f("rgb",g),j=p("color r","R",i,3);j.input.onkeyup=n;var k=p("color g","G",i,3);k.input.onkeyup=n;var l=p("color b","B",i,3);l.input.onkeyup=n;var m=p("hex","",g,6);return m.input.onkeyup=function(a){var c=a.target.value;e.set(c);var d=e.get();o(d);var f=b.rgba(d);j.input.value=Math.round(f.r()*255),k.input.value=Math.round(f.g()*255),l.input.value=Math.round(f.b()*255)},e.update(),e}});
2  grunt.js
View
@@ -4,7 +4,7 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
meta: {
- version: '0.3.0',
+ version: '0.3.5',
banner: '/*! colorjoe - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://bebraw.github.com/colorjoe/\n' +
Please sign in to comment.
Something went wrong with that request. Please try again.