UNPKG

react-color-pickers

Version:

A Collection of Color Pickers from Sketch, Photoshop, Chrome & more

3 lines (2 loc) 23.1 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(t.ReactColor=t.ReactColor||{},t.ReactColor.CustomPicker=e(t.React))}(this,function(t){"use strict";var e="default"in t?t.default:t;var r=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e){return t(e={exports:{}},e.exports),e.exports}var o="object"==typeof n&&n&&n.Object===Object&&n,i="object"==typeof self&&self&&self.Object===Object&&self,f=o||i||Function("return this")(),u=function(){return f.Date.now()},s=f.Symbol,c=Object.prototype,l=c.hasOwnProperty,h=c.toString,b=s?s.toStringTag:void 0;var g=function(t){var e=l.call(t,b),r=t[b];try{t[b]=void 0;var n=!0}catch(t){}var a=h.call(t);return n&&(e?t[b]=r:delete t[b]),a},d=Object.prototype.toString;var p=function(t){return d.call(t)},v="[object Null]",y="[object Undefined]",m=s?s.toStringTag:void 0;var _=function(t){return null==t?void 0===t?y:v:m&&m in Object(t)?g(t):p(t)};var A=function(t){return null!=t&&"object"==typeof t},x="[object Symbol]";var w=function(t){return"symbol"==typeof t||A(t)&&_(t)==x},j=NaN,S=/^\s+|\s+$/g,k=/^[-+]0x[0-9a-f]+$/i,H=/^0b[01]+$/i,C=/^0o[0-7]+$/i,O=parseInt;var R=function(t){if("number"==typeof t)return t;if(w(t))return j;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(S,"");var n=H.test(t);return n||C.test(t)?O(t.slice(2),n?2:8):k.test(t)?j:+t},F="Expected a function",T=Math.max,P=Math.min;var E=function(t,e,n){var a,o,i,f,s,c,l=0,h=!1,b=!1,g=!0;if("function"!=typeof t)throw new TypeError(F);function d(e){var r=a,n=o;return a=o=void 0,l=e,f=t.apply(n,r)}function p(t){var r=t-c;return void 0===c||r>=e||r<0||b&&t-l>=i}function v(){var t=u();if(p(t))return y(t);s=setTimeout(v,function(t){var r=e-(t-c);return b?P(r,i-(t-l)):r}(t))}function y(t){return s=void 0,g&&a?d(t):(a=o=void 0,f)}function m(){var t=u(),r=p(t);if(a=arguments,o=this,c=t,r){if(void 0===s)return function(t){return l=t,s=setTimeout(v,e),h?d(t):f}(c);if(b)return s=setTimeout(v,e),d(c)}return void 0===s&&(s=setTimeout(v,e)),f}return e=R(e)||0,r(n)&&(h=!!n.leading,i=(b="maxWait"in n)?T(R(n.maxWait)||0,e):i,g="trailing"in n?!!n.trailing:g),m.cancel=function(){void 0!==s&&clearTimeout(s),l=0,a=c=o=s=void 0},m.flush=function(){return void 0===s?f:y(u())},m};var M=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t};var N=function(t){return function(e,r,n){for(var a=-1,o=Object(e),i=n(e),f=i.length;f--;){var u=i[t?f:++a];if(!1===r(o[u],u,o))break}return e}}();var q=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n},I="[object Arguments]";var $=function(t){return A(t)&&_(t)==I},L=Object.prototype,U=L.hasOwnProperty,z=L.propertyIsEnumerable,V=$(function(){return arguments}())?$:function(t){return A(t)&&U.call(t,"callee")&&!z.call(t,"callee")},B=Array.isArray;var D=function(){return!1},W=a(function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r?f.Buffer:void 0,o=(a?a.isBuffer:void 0)||D;t.exports=o}),G=9007199254740991,X=/^(?:0|[1-9]\d*)$/;var J=function(t,e){var r=typeof t;return!!(e=null==e?G:e)&&("number"==r||"symbol"!=r&&X.test(t))&&t>-1&&t%1==0&&t<e},K=9007199254740991;var Q=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=K},Y={};Y["[object Float32Array]"]=Y["[object Float64Array]"]=Y["[object Int8Array]"]=Y["[object Int16Array]"]=Y["[object Int32Array]"]=Y["[object Uint8Array]"]=Y["[object Uint8ClampedArray]"]=Y["[object Uint16Array]"]=Y["[object Uint32Array]"]=!0,Y["[object Arguments]"]=Y["[object Array]"]=Y["[object ArrayBuffer]"]=Y["[object Boolean]"]=Y["[object DataView]"]=Y["[object Date]"]=Y["[object Error]"]=Y["[object Function]"]=Y["[object Map]"]=Y["[object Number]"]=Y["[object Object]"]=Y["[object RegExp]"]=Y["[object Set]"]=Y["[object String]"]=Y["[object WeakMap]"]=!1;var Z=function(t){return A(t)&&Q(t.length)&&!!Y[_(t)]};var tt=function(t){return function(e){return t(e)}},et=a(function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r&&o.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=i}),rt=et&&et.isTypedArray,nt=rt?tt(rt):Z,at=Object.prototype.hasOwnProperty;var ot=function(t,e){var r=B(t),n=!r&&V(t),a=!r&&!n&&W(t),o=!r&&!n&&!a&&nt(t),i=r||n||a||o,f=i?q(t.length,String):[],u=f.length;for(var s in t)!e&&!at.call(t,s)||i&&("length"==s||a&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||J(s,u))||f.push(s);return f},it=Object.prototype;var ft=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||it)};var ut=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),st=Object.prototype.hasOwnProperty;var ct=function(t){if(!ft(t))return ut(t);var e=[];for(var r in Object(t))st.call(t,r)&&"constructor"!=r&&e.push(r);return e},lt="[object AsyncFunction]",ht="[object Function]",bt="[object GeneratorFunction]",gt="[object Proxy]";var dt=function(t){if(!r(t))return!1;var e=_(t);return e==ht||e==bt||e==lt||e==gt};var pt=function(t){return null!=t&&Q(t.length)&&!dt(t)};var vt=function(t){return pt(t)?ot(t):ct(t)};var yt=function(t,e){return function(r,n){if(null==r)return r;if(!pt(r))return t(r,n);for(var a=r.length,o=e?a:-1,i=Object(r);(e?o--:++o<a)&&!1!==n(i[o],o,i););return r}}(function(t,e){return t&&N(t,e,vt)});var mt=function(t){return t};var _t=function(t){return"function"==typeof t?t:mt};var At=function(t,e){return(B(t)?M:yt)(t,_t(e))},xt=a(function(t){!function(e){var r=/^\s+/,n=/\s+$/,a=0,o=e.round,i=e.min,f=e.max,u=e.random;function s(t,u){if(t=t||"",u=u||{},t instanceof s)return t;if(!(this instanceof s))return new s(t,u);var c=function(t){var a={r:0,g:0,b:0},o=1,u=null,s=null,c=null,l=!1,h=!1;"string"==typeof t&&(t=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(H[t])t=H[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=L.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=L.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=L.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=L.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=L.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=L.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=L.hex8.exec(t))return{r:T(e[1]),g:T(e[2]),b:T(e[3]),a:N(e[4]),format:a?"name":"hex8"};if(e=L.hex6.exec(t))return{r:T(e[1]),g:T(e[2]),b:T(e[3]),format:a?"name":"hex"};if(e=L.hex4.exec(t))return{r:T(e[1]+""+e[1]),g:T(e[2]+""+e[2]),b:T(e[3]+""+e[3]),a:N(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=L.hex3.exec(t))return{r:T(e[1]+""+e[1]),g:T(e[2]+""+e[2]),b:T(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(U(t.r)&&U(t.g)&&U(t.b)?(b=t.r,g=t.g,d=t.b,a={r:255*R(b,255),g:255*R(g,255),b:255*R(d,255)},l=!0,h="%"===String(t.r).substr(-1)?"prgb":"rgb"):U(t.h)&&U(t.s)&&U(t.v)?(u=E(t.s),s=E(t.v),a=function(t,r,n){t=6*R(t,360),r=R(r,100),n=R(n,100);var a=e.floor(t),o=t-a,i=n*(1-r),f=n*(1-o*r),u=n*(1-(1-o)*r),s=a%6;return{r:255*[n,f,i,i,u,n][s],g:255*[u,n,n,f,i,i][s],b:255*[i,i,u,n,n,f][s]}}(t.h,u,s),l=!0,h="hsv"):U(t.h)&&U(t.s)&&U(t.l)&&(u=E(t.s),c=E(t.l),a=function(t,e,r){var n,a,o;function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=R(t,360),e=R(e,100),r=R(r,100),0===e)n=a=o=r;else{var f=r<.5?r*(1+e):r+e-r*e,u=2*r-f;n=i(u,f,t+1/3),a=i(u,f,t),o=i(u,f,t-1/3)}return{r:255*n,g:255*a,b:255*o}}(t.h,u,c),l=!0,h="hsl"),t.hasOwnProperty("a")&&(o=t.a));var b,g,d;return o=O(o),{ok:l,format:t.format||h,r:i(255,f(a.r,0)),g:i(255,f(a.g,0)),b:i(255,f(a.b,0)),a:o}}(t);this._originalInput=t,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=o(100*this._a)/100,this._format=u.format||c.format,this._gradientType=u.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=R(t,255),e=R(e,255),r=R(r,255);var n,a,o=f(t,e,r),u=i(t,e,r),s=(o+u)/2;if(o==u)n=a=0;else{var c=o-u;switch(a=s>.5?c/(2-o-u):c/(o+u),o){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:a,l:s}}function l(t,e,r){t=R(t,255),e=R(e,255),r=R(r,255);var n,a,o=f(t,e,r),u=i(t,e,r),s=o,c=o-u;if(a=0===o?0:c/o,o==u)n=0;else{switch(o){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:a,v:s}}function h(t,e,r,n){var a=[P(o(t).toString(16)),P(o(e).toString(16)),P(o(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function b(t,e,r,n){return[P(M(n)),P(o(t).toString(16)),P(o(e).toString(16)),P(o(r).toString(16))].join("")}function g(t,e){e=0===e?0:e||10;var r=s(t).toHsl();return r.s-=e/100,r.s=F(r.s),s(r)}function d(t,e){e=0===e?0:e||10;var r=s(t).toHsl();return r.s+=e/100,r.s=F(r.s),s(r)}function p(t){return s(t).desaturate(100)}function v(t,e){e=0===e?0:e||10;var r=s(t).toHsl();return r.l+=e/100,r.l=F(r.l),s(r)}function y(t,e){e=0===e?0:e||10;var r=s(t).toRgb();return r.r=f(0,i(255,r.r-o(-e/100*255))),r.g=f(0,i(255,r.g-o(-e/100*255))),r.b=f(0,i(255,r.b-o(-e/100*255))),s(r)}function m(t,e){e=0===e?0:e||10;var r=s(t).toHsl();return r.l-=e/100,r.l=F(r.l),s(r)}function _(t,e){var r=s(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,s(r)}function A(t){var e=s(t).toHsl();return e.h=(e.h+180)%360,s(e)}function x(t){var e=s(t).toHsl(),r=e.h;return[s(t),s({h:(r+120)%360,s:e.s,l:e.l}),s({h:(r+240)%360,s:e.s,l:e.l})]}function w(t){var e=s(t).toHsl(),r=e.h;return[s(t),s({h:(r+90)%360,s:e.s,l:e.l}),s({h:(r+180)%360,s:e.s,l:e.l}),s({h:(r+270)%360,s:e.s,l:e.l})]}function j(t){var e=s(t).toHsl(),r=e.h;return[s(t),s({h:(r+72)%360,s:e.s,l:e.l}),s({h:(r+216)%360,s:e.s,l:e.l})]}function S(t,e,r){e=e||6,r=r||30;var n=s(t).toHsl(),a=360/r,o=[s(t)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,o.push(s(n));return o}function k(t,e){e=e||6;for(var r=s(t).toHsv(),n=r.h,a=r.s,o=r.v,i=[],f=1/e;e--;)i.push(s({h:n,s:a,v:o})),o=(o+f)%1;return i}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=O(t),this._roundA=o(100*this._a)/100,this},toHsv:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=l(this._r,this._g,this._b),e=o(360*t.h),r=o(100*t.s),n=o(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=o(360*t.h),r=o(100*t.s),n=o(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var i=[P(o(t).toString(16)),P(o(e).toString(16)),P(o(r).toString(16)),P(M(n))];if(a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(100*R(this._r,255))+"%",g:o(100*R(this._g,255))+"%",b:o(100*R(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+o(100*R(this._r,255))+"%, "+o(100*R(this._g,255))+"%, "+o(100*R(this._b,255))+"%)":"rgba("+o(100*R(this._r,255))+"%, "+o(100*R(this._g,255))+"%, "+o(100*R(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+b(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=s(t);r="#"+b(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return s(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(p,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(A,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(j,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},s.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:E(t[n]));t=r}return s(t,e)},s.equals=function(t,e){return!(!t||!e)&&s(t).toRgbString()==s(e).toRgbString()},s.random=function(){return s.fromRatio({r:u(),g:u(),b:u()})},s.mix=function(t,e,r){r=0===r?0:r||50;var n=s(t).toRgb(),a=s(e).toRgb(),o=r/100;return s({r:(a.r-n.r)*o+n.r,g:(a.g-n.g)*o+n.g,b:(a.b-n.b)*o+n.b,a:(a.a-n.a)*o+n.a})},s.readability=function(t,r){var n=s(t),a=s(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},s.isReadable=function(t,e,r){var n,a,o=s.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},s.mostReadable=function(t,e,r){var n,a,o,i,f=null,u=0;a=(r=r||{}).includeFallbackColors,o=r.level,i=r.size;for(var c=0;c<e.length;c++)(n=s.readability(t,e[c]))>u&&(u=n,f=s(e[c]));return s.isReadable(t,f,{level:o,size:i})||!a?f:(r.includeFallbackColors=!1,s.mostReadable(t,["#fff","#000"],r))};var H=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=s.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(H);function O(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function R(t,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=i(r,f(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function F(t){return i(1,f(0,t))}function T(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function E(t){return t<=1&&(t=100*t+"%"),t}function M(t){return e.round(255*parseFloat(t)).toString(16)}function N(t){return T(t)/255}var q,I,$,L=(I="[\\s|\\(]+("+(q="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",$="[\\s|\\(]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",{CSS_UNIT:new RegExp(q),rgb:new RegExp("rgb"+I),rgba:new RegExp("rgba"+$),hsl:new RegExp("hsl"+I),hsla:new RegExp("hsla"+$),hsv:new RegExp("hsv"+I),hsva:new RegExp("hsva"+$),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!L.CSS_UNIT.exec(t)}t.exports?t.exports=s:window.tinycolor=s}(Math)}),wt={simpleCheckForValidColor:function(t){var e=0,r=0;return At(["r","g","b","a","h","s","l","v"],function(n){if(t[n]&&(e+=1,isNaN(t[n])||(r+=1),"s"===n||"l"===n)){/^\d+%$/.test(t[n])&&(r+=1)}}),e===r&&t},toState:function(t,e){var r=t.hex?xt(t.hex):xt(t),n=r.toHsl(),a=r.toHsv(),o=r.toRgb(),i=r.toHex();return 0===n.s&&(n.h=e||0,a.h=e||0),{hsl:n,hex:"000000"===i&&0===o.a?"transparent":"#"+i,rgb:o,hsv:a,oldHue:t.h||e||n.h,source:t.source}},isValidHex:function(t){var e="#"===String(t).charAt(0)?1:0;return t.length!==4+e&&t.length<7+e&&xt(t).isValid()},getContrastingColor:function(t){if(!t)return"#fff";var e=this.toState(t);return"transparent"===e.hex?"rgba(0,0,0,0.4)":(299*e.rgb.r+587*e.rgb.g+114*e.rgb.b)/1e3>=128?"#000":"#fff"}},jt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},St=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),kt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ht=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e};return function(r){var n=function(n){function a(t){jt(this,a);var e=Ht(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return e.handleChange=function(t,r){if(wt.simpleCheckForValidColor(t)){var n=wt.toState(t,t.h||e.state.oldHue);e.setState(n),e.props.onChangeComplete&&e.debounce(e.props.onChangeComplete,n,r),e.props.onChange&&e.props.onChange(n,r)}},e.handleSwatchHover=function(t,r){if(wt.simpleCheckForValidColor(t)){var n=wt.toState(t,t.h||e.state.oldHue);e.setState(n),e.props.onSwatchHover&&e.props.onSwatchHover(n,r)}},e.state=kt({},wt.toState(t.color,0)),e.debounce=E(function(t,e,r){t(e,r)},100),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,t.PureComponent||t.Component),St(a,[{key:"componentWillReceiveProps",value:function(t){this.setState(kt({},wt.toState(t.color,this.state.oldHue)))}},{key:"render",value:function(){var t={};return this.props.onSwatchHover&&(t.onSwatchHover=this.handleSwatchHover),e.createElement(r,kt({},this.props,this.state,{onChange:this.handleChange},t))}}]),a}();return n.propTypes=kt({},r.propTypes),n.defaultProps=kt({},r.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),n}}); //# sourceMappingURL=custom.min.js.map