Comparing version 1.0.0-beta.0 to 1.0.0-beta.1
@@ -1,109 +0,1 @@ | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.getColorFromString = void 0; | ||
var _react = _interopRequireWildcard(__webpack_require__(1)); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
var goldenNumber = (1 + Math.sqrt(5)) / 2; | ||
var getCharCode = function getCharCode(char) { | ||
return char.charCodeAt(0) - 96; | ||
}; | ||
var getColorFromString = function getColorFromString(string) { | ||
var saturation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.8; | ||
var luminosity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.6; | ||
var opacity = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; | ||
var cleanString = string.replace(/\s/g, ''); | ||
var hue = cleanString.split('').reduce(function (r, v) { | ||
return r + getCharCode(v); | ||
}, 0); | ||
return "hsla(".concat(hue * string.length * goldenNumber, ", ").concat(saturation * 100, "%, ").concat(luminosity * 100, "%, ").concat(opacity, ")"); | ||
}; | ||
exports.getColorFromString = getColorFromString; | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports) { | ||
module.exports = react; | ||
/***/ }) | ||
/******/ ]); | ||
//# sourceMappingURL=bundle.js.map | ||
!function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getColorFromString=void 0;var n=(1+Math.sqrt(5))/2,o=function(t){return t.charCodeAt(0)-96},c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.6,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return"hsla(".concat(t.replace(/\s/g,"").split("").reduce(function(t,e){return t+o(e)},0)*t.length*n,", ").concat(100*e,"%, ").concat(100*r,"%, ").concat(c,")")};e.getColorFromString=c}]); |
{ | ||
"name": "@ied/color", | ||
"version": "1.0.0-beta.0", | ||
"version": "1.0.0-beta.1", | ||
"main": "dist/bundle.js", | ||
"author": "Didier Franc", | ||
"license": "MIT", | ||
"files": [ | ||
"package.json", | ||
"README.md", | ||
"dist/" | ||
], | ||
"files": ["package.json", "README.md", "dist/"], | ||
"dependencies": { | ||
@@ -13,0 +9,0 @@ "react": "^16.2.0", |
# Color | ||
## Install | ||
``` | ||
yarn add @ied/color | ||
``` | ||
## Use | ||
```js | ||
@@ -12,3 +20,3 @@ import { getColorFromString } from '@ied/color' | ||
### Types | ||
## Types | ||
@@ -15,0 +23,0 @@ ```js |
Sorry, the diff of this file is not supported yet
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
30
4867
0
1