{ "version": 3, "sources": [ "webpack:///webpack/universalModuleDefinition", "webpack:///webpack/bootstrap 3f29667c04674277742a", "webpack:///./src/index.js" ], "names": [], "mappings": "AAAA,cACA,2BACA,uCACA,sCACA,cACA,GACA,qDAEA,0BACA,GAAC,mBACD,kBCTA,cAMA,MACA,eAGA,mBACA,GACA,EACA,KAIA,mDAGA,KAGA,OACA,OAIA,IAzBA,iBA4BA,MAGA,iBAA2C,OAAc,EAGzD,qBACA,OACA,8BACA,CACA,gBACA,kBAGA,GAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,OAAe,EAChD,mBACA,GACA,CAGA,mBAAsD,+CAA+D,EAGrH,MAGA,yCCnDuC,eACrC,IAAI,CAAC,UACH,aAGF,MACE,CADE,aAAU,aACL,GAAW,KAAK,KAGzB,MAAI,EAAuB,QAArB,QAAO,IAA0B,EACrC,aAAM,IAAI,WAGZ,yDAAU,WACV,GAAI,MACF,QAAM,IAAI,oCAAiC,EAG7C,qCAAY,EACZ,cAAI,CAAC,EACH,QAAM,IAAI,kCAAiC,EAG7C,QAAM,GAAY,EAClB,GAAM,EAAa,KAAK,MAAM,EAAM,EAClC,EAAU,IACV,EAAU,IACV,EAGF,UAAO,GACR,EAED,CA+CiD,qBAC/C,OAED,EAFS,EAAC,EAAQ,IAAY,EAAS,IAAU,EAAW,GAAW,C,oDAjFxD,aAsCT,GAAM,KAgBb,8IAAM,EAAW,EAcV,OAAM,WACX,GACE,KAAK,CACL,OAEF,OACE,KAAK,CACL,OAIJ", "file": "the-color-of-air.min.js", "sourcesContent": [ "(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"the-color-of-air\"] = factory();\n\telse\n\t\troot[\"the-color-of-air\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition", " \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3f29667c04674277742a", "/**\n * Given a `scaleName` and a numeric value, provide a color representing the\n * relative air temperature.\n *\n * This function is curried (naively).\n * @param {string} [scaleName] - One of `F`, or `C`. Case-insensitive.\n * @param {number|string} [degrees] - Degrees in specified scale. Coerced to a\n * float. Optional if currying.\n * @returns {Function|string} Curried function or CSS-hex-style color w/ `#`\n * prefix.\n * @throws {TypeError} When non-string `scaleName` or `NaN` `degrees`\n * @throws {ReferenceError} When unknown `scaleName`\n */\nexport function colorOfAir (scaleName, degrees) {\n if (!arguments.length) {\n return colorOfAir;\n }\n\n if (arguments.length === 1) {\n return colorOfAir.bind(null, scaleName);\n }\n\n if (!(typeof scaleName === 'string' && scaleName.length)) {\n throw new TypeError(`'scaleName' argument must be a nonempty string`);\n }\n\n degrees = parseFloat(degrees);\n if (isNaN(degrees)) {\n throw new TypeError(`'degrees' argument \"${degrees}\" cannot be coerced to float`);\n }\n\n scaleName = scaleName.toLowerCase();\n if (!scales[scaleName]) {\n throw new ReferenceError(`unknown scale \"${scaleName}\"`);\n }\n\n const tempScale = scales[scaleName];\n const colorIndex = Math.round(scale(degrees,\n tempScale.min,\n tempScale.max,\n 0,\n scaleMax));\n\n return colorList[colorIndex];\n}\n\n/**\n * From \"coldest\" to \"hottest\".\n * See `swatches/` for other formats if you want 'em.\n * @type {string[]}\n */\nexport const colorList = [\n '#feffff',\n '#d1c9df',\n '#a496c0',\n '#3993ce',\n '#0772b8',\n '#03902b',\n '#2dc558',\n '#fecf3b',\n '#ec9800',\n '#dd531e',\n '#c53600',\n '#b10909',\n '#6f0015'\n];\n\nconst scaleMax = colorList.length;\n\n/**\n * Every value equal to or lower than `min` is the first array item, and\n * every value equal to or greater than `max` is the last array item.\n *\n * These values were determined in part by AccuWeather's legend, but adjusted\n * slightly to ensure a reasonable distribution for both F and C.\n *\n * Because of the fudging, Fahrenheit will show \"hotter\" colors at slightly\n * \"colder\" temperatures than Celsius.\n *\n * @type {{f: {min: number, max: number}, c: {min: number, max: number}}}\n */\nexport const scales = {\n f: {\n min: -10,\n max: 107\n },\n c: {\n min: -23,\n max: 42\n }\n};\n\n// stolen from https://npm.im/johnny-five\nfunction scale (value, fromLow, fromHigh, toLow, toHigh) {\n return ((value - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow) |\n 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js" ], "sourceRoot": "" }