{"_id":"@dominate-color.js/core","_rev":"2-cb1b706e2d65634c1298ed8cdc1a15f6","name":"@dominate-color.js/core","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@dominate-color.js/core","version":"1.0.0","keywords":["colors","dominant color","color analysis","color palette","TypeScript","color algorithms","color detection","computer vision","image processing","color spaces"],"author":{"name":"TrySquad DF","email":"https://t.me/TrySquadDF"},"license":"MIT","_id":"@dominate-color.js/core@1.0.0","maintainers":[{"name":"trysquaddf","email":"sjpdkedkdjkdkdjdmddd@gmail.com"}],"homepage":"https://github.com/Dominate-color/dominate-color-js#readme","bugs":{"url":"https://github.com/Dominate-color/dominate-color-js/issues"},"dist":{"shasum":"8a84b97aea2ed9edb7f3b969b87bfe71e0adb7ae","tarball":"https://registry.npmjs.org/@dominate-color.js/core/-/core-1.0.0.tgz","fileCount":53,"integrity":"sha512-wIQHiwH81PR2AAXFCRbk+hNu3+fntaPviBkjYZVGzLoqEJm4m9EbJ6fvLIvGkeRxAbpMSDi5AEPvJgarMF+1ag==","signatures":[{"sig":"MEUCIQCQyc+Q17WWgAlOLVJPsQ/XtWA8jbzmNK9dUJ2ROCwU4wIgI++pLI+Lg7PZjVTUPTb1SsWfdY2VZUx+DxOroHXeibE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81912},"main":"./dist/index.cjs","type":"module","_from":"file:dominate-color.js-core-1.0.0.tgz","types":"./dist/dts/index.d.ts","module":"./dist/index.mjs","browser":"./dist/index.iife.js","exports":{".":{"types":"./dist/dts/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.cjs","require":"./dist/index.cjs"}},"scripts":{"lint":"eslint -c .eslintrc.cjs src/**/* tests/**/*","test":"vitest","build":"pnpm run build:default","rollup":"pnpm run typecheck && pnpm run build","typecheck":"tsc --noEmit -p tsconfig.build.json","build:default":"vite build --config vite.config.ts"},"_npmUser":{"name":"trysquaddf","email":"sjpdkedkdjkdkdjdmddd@gmail.com"},"_resolved":"/tmp/14b427d18e661228ce0b639382e67963/dominate-color.js-core-1.0.0.tgz","_integrity":"sha512-wIQHiwH81PR2AAXFCRbk+hNu3+fntaPviBkjYZVGzLoqEJm4m9EbJ6fvLIvGkeRxAbpMSDi5AEPvJgarMF+1ag==","repository":{"url":"git+https://github.com/Dominate-color/dominate-color-js.git","type":"git","directory":"packages/core"},"_npmVersion":"9.8.1","description":"A library that can extract the primary color and its hue in RGBA format and convert it.","directories":{},"sideEffects":false,"_nodeVersion":"18.18.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsconfig":"1.0.0","build-utils":"1.0.0","eslint-config-custom":"1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.0_1701631179921_0.16626457308522657","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@dominate-color.js/core","version":"1.1.0","keywords":["colors","dominant color","color analysis","color palette","TypeScript","color algorithms","color detection","computer vision","image processing","color spaces"],"author":{"name":"TrySquad DF","email":"https://t.me/TrySquadDF"},"license":"MIT","_id":"@dominate-color.js/core@1.1.0","maintainers":[{"name":"trysquaddf","email":"sjpdkedkdjkdkdjdmddd@gmail.com"}],"homepage":"https://github.com/Dominate-color/dominate-color-js#readme","bugs":{"url":"https://github.com/Dominate-color/dominate-color-js/issues"},"dist":{"shasum":"6721cb49521c0b4f477eb02412289baa165de795","tarball":"https://registry.npmjs.org/@dominate-color.js/core/-/core-1.1.0.tgz","fileCount":53,"integrity":"sha512-sAonqKeQ6DakQxTfQ+SrKtnQQ1P3LLxdSi/5mU85sBS2Ux1NR59lO8eiC9TRGCz2ZmmTMgl4FygSuV7a3R+hRQ==","signatures":[{"sig":"MEUCIGJFH2LHWY7cF4NVUYvuNioPN36QyxunsltgXWDNSaQxAiEAxqeUbtvpb1BDyAYdsuoaFiV/AsJ7fQJ2oifBVGtMJqY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91953},"main":"./dist/index.cjs","type":"module","_from":"file:dominate-color.js-core-1.1.0.tgz","types":"./dist/dts/index.d.ts","module":"./dist/index.mjs","browser":"./dist/index.iife.js","exports":{".":{"types":"./dist/dts/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.cjs","require":"./dist/index.cjs"}},"scripts":{"lint":"eslint -c .eslintrc.cjs src/**/* tests/**/*","test":"vitest","build":"pnpm run build:default","rollup":"pnpm run typecheck && pnpm run build","typecheck":"tsc --noEmit -p tsconfig.build.json","build:default":"vite build --config vite.config.ts"},"_npmUser":{"name":"trysquaddf","email":"sjpdkedkdjkdkdjdmddd@gmail.com"},"_resolved":"/tmp/3a83e40738a830edfd857cfee9406b7d/dominate-color.js-core-1.1.0.tgz","_integrity":"sha512-sAonqKeQ6DakQxTfQ+SrKtnQQ1P3LLxdSi/5mU85sBS2Ux1NR59lO8eiC9TRGCz2ZmmTMgl4FygSuV7a3R+hRQ==","repository":{"url":"git+https://github.com/Dominate-color/dominate-color-js.git","type":"git","directory":"packages/core"},"_npmVersion":"10.2.3","description":"A library that can extract the primary color and its hue in RGBA format and convert it.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsconfig":"1.0.0","build-utils":"1.0.0","eslint-config-custom":"1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/core_1.1.0_1702776132313_0.14296552206965618","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@dominate-color.js/core","version":"1.1.1","description":"A library that can extract the primary color and its hue in RGBA format and convert it.","author":{"name":"TrySquad DF","email":"https://t.me/TrySquadDF"},"homepage":"https://github.com/Dominate-color/dominate-color-js#readme","repository":{"type":"git","url":"git+https://github.com/Dominate-color/dominate-color-js.git","directory":"packages/core"},"bugs":{"url":"https://github.com/Dominate-color/dominate-color-js/issues"},"keywords":["colors","dominant color","color analysis","color palette","TypeScript","color algorithms","color detection","computer vision","image processing","color spaces"],"license":"MIT","type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/dts/index.d.ts","exports":{".":{"types":"./dist/dts/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.cjs"}},"devDependencies":{"canvas":"^2.11.2","happy-dom":"^15.7.4","tsconfig":"1.0.0","eslint-config-custom":"1.1.1"},"publishConfig":{"access":"public","provenance":true},"scripts":{"test":"vitest","lint":"eslint -c .eslintrc.cjs src/**/* tests/**/*","typecheck":"tsc --noEmit -p tsconfig.build.json","build":"pnpm run build:default","build:default":"vite build --config vite.config.ts","rollup":"pnpm run typecheck && pnpm run build"},"_id":"@dominate-color.js/core@1.1.1","_integrity":"sha512-g9usABZjnB0Djq+eCRRyaQKunkXwF4qEKFk9IKd4SC72/Mz3z1hStqEqFlh9rhhCUL1389OcdOC2Kc/zfAh/pA==","_resolved":"/tmp/651946d0ffbc15609eb402d17f64ba3f/dominate-color.js-core-1.1.1.tgz","_from":"file:dominate-color.js-core-1.1.1.tgz","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-g9usABZjnB0Djq+eCRRyaQKunkXwF4qEKFk9IKd4SC72/Mz3z1hStqEqFlh9rhhCUL1389OcdOC2Kc/zfAh/pA==","shasum":"190cc9ad43f419f6ca268180f58790ed8b48a1bf","tarball":"https://registry.npmjs.org/@dominate-color.js/core/-/core-1.1.1.tgz","fileCount":52,"unpackedSize":87867,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dominate-color.js%2fcore@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHQS9sRbOIqBRpXfiWWZKDAMCQslJQcOOKotmjR/0ZhwIhAKj0+p4Ak36Rz9vDMTdgPcQ/ApJFuuJGsXhrNahGjB94"}]},"_npmUser":{"name":"trysquaddf","email":"sjpdkedkdjkdkdjdmddd@gmail.com"},"directories":{},"maintainers":[{"name":"trysquaddf","email":"sjpdkedkdjkdkdjdmddd@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_1.1.1_1728905954399_0.11629576915771711"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-03T19:19:39.811Z","modified":"2024-10-14T11:39:15.042Z","1.0.0":"2023-12-03T19:19:40.090Z","1.1.0":"2023-12-17T01:22:12.498Z","1.1.1":"2024-10-14T11:39:14.638Z"},"bugs":{"url":"https://github.com/Dominate-color/dominate-color-js/issues"},"author":{"name":"TrySquad DF","email":"https://t.me/TrySquadDF"},"license":"MIT","homepage":"https://github.com/Dominate-color/dominate-color-js#readme","keywords":["colors","dominant color","color analysis","color palette","TypeScript","color algorithms","color detection","computer vision","image processing","color spaces"],"repository":{"type":"git","url":"git+https://github.com/Dominate-color/dominate-color-js.git","directory":"packages/core"},"description":"A library that can extract the primary color and its hue in RGBA format and convert it.","maintainers":[{"name":"trysquaddf","email":"sjpdkedkdjkdkdjdmddd@gmail.com"}],"readme":"[code-badge]: https://img.shields.io/badge/source-black?logo=github\n\n### `@dominate-color.js/core`\n\n[core-npm-badge]: https://img.shields.io/npm/v/@dominate-color.js/core?logo=npm\n\n[![core-npm-badge]](https://npmjs.com/package/@dominate-color.js/core)\n![Size](https://img.shields.io/bundlephobia/minzip/@dominate-color.js/core)\n[![code-badge]](https://github.com/Dominate-color/dominate-color-js/tree/master/packages/core)\n\nA robust TypeScript library for color detection in images. The `@dominate-color.js/core` package provides essential functionality to identify and extract dominant colors from an image source. The library is built to cater to various use cases, from creating color-based aesthetic layouts to implementing dynamic theming based on image colors in your applications.\n\n#### `colorDetection()`\n\nThe `colorDetection` function is a cornerstone of the `@dominate-color.js/core` package, enabling developers to easily detect colors in an image. It accepts an image source and optional configuration parameters, returning a promise that resolves with an array of the most dominant RGBA colors found in the image.\n\n##### Features\n\n- Supports various image sources, including URLs, file paths, and buffers.\n- Offers configurable settings to fine-tune color detection.\n- Utilizes efficient algorithms for fast and accurate color extraction.\n\n##### Getting Started\n\nBefore integrating `colorDetection` into your project, it is advisable to go through the provided documentation to understand how to use the function effectively. This function is designed to be straightforward and flexible, allowing for easy adaptation to your specific needs.\n\n##### Installation\n\nFirst, install the `@dominate-color.js/core` package using npm, pnpm or yarn:\n\n```bash\nnpm install @dominate-color.js/core\n# or\nyarn add @dominate-color.js/core\n```\n\n##### Usage\n\nTo use colorDetection() in your project, follow these steps:\n\n1. Import the colorDetection function from the package:\n```typescript \nimport { colorDetection } from '@dominate-color.js/core';\n```\n2. Prepare your image source. This can be a URL, a local file path, or an ArrayBuffer.\n3. (Optional) Set up your configuration options. You can specify the distance method, the number k of colors to detect, and AccessControlAllowOrigin for CORS settings.\n4. Call colorDetection() with your image source and optional configuration:\n```typescript\n    import { colorDetection, type Config } from '@dominate-color.js/core';\n     \n    const config: Config = {\n        distance: 'euclidean', // Choose the 'euclidean' algorithm for color distance calculation\n        k: 5, // Detect the top 5 dominant colors\n        AccessControlAllowOrigin: '*' // Useful for CORS when fetching images from external URLs\n    };\n\n    // Replace `source.url` with the path to your image or any other type supported by the `colorDetection` function when calling it.\n    colorDetection(source.url, config)\n        .then(colors => {\n            console.log('Detected Colors with custom config:', colors);\n            updateUIWithColors(colors);\n        })\n        .catch(error => {\n            console.error('Error detecting colors with custom config:', error);\n            warnUserSomethingWentWrong(error)\n        });\n```","readmeFilename":"README.md"}