colors-generator
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -1,1 +0,1 @@ | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.colors=r():t.colors=r()}(this,function(){return function(t){function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n={};return r.m=t,r.c=n,r.i=function(t){return t},r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:e})},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=2)}([function(t,r,n){"use strict";function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,r){for(var n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(r,n,e){return n&&t(r.prototype,n),e&&t(r,e),r}}(),u=n(1),i=function(){function t(){e(this,t),this.colors=[]}return o(t,[{key:"get",value:function(){return this.colors}},{key:"generate",value:function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=(0,u.RGBToHSL)(t),e=360*n[0],o=360/r,i=[],a=0;a<r;a++){var c=(e+a*o)%360/360;i.push((0,u.HSLToRGB)([c,n[1],n[2]]))}return this.colors=i,this}},{key:"lighter",value:function(t){return this.colors=this.colors.map(function(r){var n=(0,u.RGBToHSL)(r);return n[2]=Math.min(n[2]+t,1),(0,u.HSLToRGB)(n)}),this}},{key:"darker",value:function(t){return this.colors=this.colors.map(function(r){var n=(0,u.RGBToHSL)(r);return n[2]=Math.max(n[2]-t,0),(0,u.HSLToRGB)(n)}),this}},{key:"purer",value:function(t){return this.colors=this.colors.map(function(r){var n=(0,u.RGBToHSL)(r);return n[1]=Math.min(n[1]+t,1),(0,u.HSLToRGB)(n)}),this}},{key:"impurer",value:function(t){return this.colors=this.colors.map(function(r){var n=(0,u.RGBToHSL)(r);return n[1]=Math.max(n[1]-t,0),(0,u.HSLToRGB)(n)}),this}}]),t}();t.exports=new i},function(t,r,n){"use strict";function e(t){var r=a(t,3),n=r[0],e=r[1],o=r[2],u=void 0,c=void 0,s=void 0,f=function(t,r,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(r-t)*n:n<.5?r:n<2/3?t+(r-t)*(2/3-n)*6:t};if(0===e)u=c=s=o;else{var l=o<.5?o*(1+e):o+e-o*e,h=2*o-l;u=f(h,l,n+1/3),c=f(h,l,n),s=f(h,l,n-1/3)}return"#"+[255*u,255*c,255*s].map(function(t){return i(Math.round(t))}).join("")}function o(t){t=t.substr(t.indexOf("#")+1),3===t.length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=u(t.substr(0,2))/255,n=u(t.substr(2,2))/255,e=u(t.substr(4,2))/255,o=Math.max(r,n,e),i=Math.min(r,n,e),a=o-i,c=(o+i)/2,s=0,f=0;if(a){switch(f=c>.5?a/(2-o-i):a/(o+i),o){case r:s=(n-e)/a+(n<e?6:0);break;case n:s=(e-r)/a+2;break;case e:s=(r-n)/a+4}s/=6}return[s,f,c]}function u(t){return parseInt(t,16)}function i(t){var r=t.toString(16);return 1===r.length?"0"+r:r}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function t(t,r){var n=[],e=!0,o=!1,u=void 0;try{for(var i,a=t[Symbol.iterator]();!(e=(i=a.next()).done)&&(n.push(i.value),!r||n.length!==r);e=!0);}catch(t){o=!0,u=t}finally{try{!e&&a.return&&a.return()}finally{if(o)throw u}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();r.HSLToRGB=e,r.RGBToHSL=o},function(t,r,n){"use strict";t.exports=n(0)}])}); | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.colorsGenerator=r():t.colorsGenerator=r()}(this,function(){return function(t){function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n={};return r.m=t,r.c=n,r.i=function(t){return t},r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:e})},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=2)}([function(t,r,n){"use strict";function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,r){for(var n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(r,n,e){return n&&t(r.prototype,n),e&&t(r,e),r}}(),u=n(1),i=function(){function t(){e(this,t),this.colors=[]}return o(t,[{key:"get",value:function(){return this.colors}},{key:"generate",value:function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=(0,u.RGBToHSL)(t),e=360*n[0],o=360/r,i=[],a=0;a<r;a++){var c=(e+a*o)%360/360;i.push((0,u.HSLToRGB)([c,n[1],n[2]]))}return this.colors=i,this}},{key:"lighter",value:function(t){return this.colors=this.colors.map(function(r){var n=(0,u.RGBToHSL)(r);return n[2]=Math.min(n[2]+t,1),(0,u.HSLToRGB)(n)}),this}},{key:"darker",value:function(t){return this.colors=this.colors.map(function(r){var n=(0,u.RGBToHSL)(r);return n[2]=Math.max(n[2]-t,0),(0,u.HSLToRGB)(n)}),this}},{key:"purer",value:function(t){return this.colors=this.colors.map(function(r){var n=(0,u.RGBToHSL)(r);return n[1]=Math.min(n[1]+t,1),(0,u.HSLToRGB)(n)}),this}},{key:"impurer",value:function(t){return this.colors=this.colors.map(function(r){var n=(0,u.RGBToHSL)(r);return n[1]=Math.max(n[1]-t,0),(0,u.HSLToRGB)(n)}),this}}]),t}();t.exports=new i},function(t,r,n){"use strict";function e(t){var r=a(t,3),n=r[0],e=r[1],o=r[2],u=void 0,c=void 0,s=void 0,f=function(t,r,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(r-t)*n:n<.5?r:n<2/3?t+(r-t)*(2/3-n)*6:t};if(0===e)u=c=s=o;else{var l=o<.5?o*(1+e):o+e-o*e,h=2*o-l;u=f(h,l,n+1/3),c=f(h,l,n),s=f(h,l,n-1/3)}return"#"+[255*u,255*c,255*s].map(function(t){return i(Math.round(t))}).join("")}function o(t){t=t.substr(t.indexOf("#")+1),3===t.length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=u(t.substr(0,2))/255,n=u(t.substr(2,2))/255,e=u(t.substr(4,2))/255,o=Math.max(r,n,e),i=Math.min(r,n,e),a=o-i,c=(o+i)/2,s=0,f=0;if(a){switch(f=c>.5?a/(2-o-i):a/(o+i),o){case r:s=(n-e)/a+(n<e?6:0);break;case n:s=(e-r)/a+2;break;case e:s=(r-n)/a+4}s/=6}return[s,f,c]}function u(t){return parseInt(t,16)}function i(t){var r=t.toString(16);return 1===r.length?"0"+r:r}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function t(t,r){var n=[],e=!0,o=!1,u=void 0;try{for(var i,a=t[Symbol.iterator]();!(e=(i=a.next()).done)&&(n.push(i.value),!r||n.length!==r);e=!0);}catch(t){o=!0,u=t}finally{try{!e&&a.return&&a.return()}finally{if(o)throw u}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();r.HSLToRGB=e,r.RGBToHSL=o},function(t,r,n){"use strict";t.exports=n(0)}])}); |
{ | ||
"name": "colors-generator", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/colors-generator.js", |
import { | ||
parseHex, | ||
RGBToHSL, | ||
@@ -4,0 +3,0 @@ HSLToRGB |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
226241
11
178