color-octree
Advanced tools
+2
-4
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| function _slicedToArray(arr, i) { | ||
@@ -77,2 +75,3 @@ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
| }; | ||
| class ColorOctant { | ||
@@ -156,3 +155,2 @@ constructor(path = []) { | ||
| exports.hexToOctants = hexToOctants; | ||
| exports.default = ColorOctant; | ||
| module.exports = ColorOctant; |
+1
-1
@@ -73,2 +73,3 @@ function _slicedToArray(arr, i) { | ||
| }; | ||
| class ColorOctant { | ||
@@ -153,2 +154,1 @@ constructor(path = []) { | ||
| export default ColorOctant; | ||
| export { hexToOctants }; |
+6
-8
| (function (global, factory) { | ||
| typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
| typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
| (factory((global.colorutil = {}))); | ||
| }(this, (function (exports) { 'use strict'; | ||
| typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
| typeof define === 'function' && define.amd ? define(factory) : | ||
| (global.colorutil = factory()); | ||
| }(this, (function () { 'use strict'; | ||
@@ -79,2 +79,3 @@ function _slicedToArray(arr, i) { | ||
| }; | ||
| class ColorOctant { | ||
@@ -158,7 +159,4 @@ constructor(path = []) { | ||
| exports.hexToOctants = hexToOctants; | ||
| exports.default = ColorOctant; | ||
| return ColorOctant; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| }))); |
+1
-1
@@ -10,3 +10,3 @@ const parseHex = hex => hex.length < 6 ? hex[hex.length-3].repeat(2)+hex[hex.length-2].repeat(2)+hex[hex.length-1].repeat(2) : hex.slice(-6); | ||
| export const hexToOctants = hex => { | ||
| const hexToOctants = hex => { | ||
| const h = parseHex(hex); | ||
@@ -13,0 +13,0 @@ const [r,g,b] = Array.from({length:3}, (_,i)=>parseInt(h.slice(2*i, 2*i+2), 16).toString(2).padStart(8,0)) |
+1
-1
| { | ||
| "name": "color-octree", | ||
| "version": "1.1.0", | ||
| "version": "1.1.1", | ||
| "description": "Get closest hex color", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs.js", |
14803
-1.73%441
-1.12%