Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.3.3 #6

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "color-2-name",
"version": "1.3.2",
"version": "1.3.3",
"author": "Erik <erik@codekraft.it>",
"description": "Finds the closest color name to a given hex, rgb and hsl color (with and without alpha). It uses the Euclidean distance formula to calculate the distance between colors in the RGB color space",
"homepage": "https://wp-blocks.github.io/color-2-name/",
Expand All @@ -10,6 +10,7 @@
"main": "lib/cjs/index.cjs",
"require": "lib/cjs/index.js",
"import": "lib/esm/index.js",
"types": "lib/@types/index.d.ts",
"browser": "lib/browser/color-2-name.min.js",
"unpkg": "lib/browser/color-2-name.min.js",
"jsdelivr": "lib/browser/color-2-name.js",
Expand All @@ -21,14 +22,7 @@
"module-tsc": "tsc --declaration --emitDeclarationOnly --outDir lib/@types --rootDir src",
"module-rollup": "rollup -c"
},
"files": [
"lib/",
"tests/*.ts",
"*.json",
".gitignore",
"LICENSE",
"readme.md"
],
"files": ["lib/", "tests/*.ts", "*.json", "*.md", ".gitignore", "LICENSE"],
"repository": {
"type": "git",
"url": "https://github.com/wp-blocks/color-2-name.git"
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ It uses the Euclidean distance formula to calculate the distance between colors
- 🚀 **Fast** - The distance between colors in the RGB color space is provided with the fastest algorithm available (check below)
- 😎 **Ally** - So that your app is equally useful for everyone
- 📒 **Well Documented** - Checkout the [documentation](https://wp-blocks.github.io/color-2-name/) with examples, demo and code references
- 🪶 **Lightweight** - The module WITH the 140 css colors definitions [weights 4kb gzipped](https://bundlephobia.com/package/color-2-name@1.1.1)!
- 🪶 **Lightweight** - The module WITH the 140 css colors definitions [weights 3.5kb gzipped](https://bundlephobia.com/package/color-2-name)!
- 📦 **Bundled** - Optimized and minified build, with ESM, CJS and iife browser versions available!
- 💪️ **Typed** - Written in typescript (with types included)
- 🛡️️ **Tested** - Over 4000 tests (most of all from [wpt](https://github.com/web-platform-tests/wpt/)) with 100% coverage to ensure the full adherence to the css standards
- 🎈 **No dependencies** - Dependencies tend to have dependencies endlessly, and this can lead to security issues. This is a small module, and it doesn't need anything else!

## 🚀 Benchmarks

Designed with the performance in mind, it is 20 times faster than the self-proclaimed fastest color conversion plugin!
Designed with the performance in mind, it is 10 times faster than the self-proclaimed fastest color conversion plugin!

| Library | <nobr>Operations/sec</nobr> | Size<br /> (minified) | Size<br /> (gzipped) |
|--------------------------------------------------------------------|---------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <nobr><b>[color-2-name](#color-2-name) v1.3.2 🚀</b></nobr> | <nobr>🟢 <b>11 955 ops/s,</b> ±0.29%</nobr> | [![color-2-name](https://snyk.io/advisor/npm-package/color-2-name/badge.svg)](https://snyk.io/advisor/npm-package/color-2-name) | [![](https://badgen.net/bundlephobia/minzip/color-2-name?color=yellow&label=)](https://bundlephobia.com/result?p=color-2-name) |
| <nobr>[colord](https://www.npmjs.com/package/colord) v2.9.3</nobr> | <nobr>🔴 765 ops/s, ±0.39% ( 93.6% slower)</nobr> | [![colord](https://snyk.io/advisor/npm-package/colord/badge.svg)](https://snyk.io/advisor/npm-package/colord) | [![](https://badgen.net/bundlephobia/minzip/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) + [plugins](https://github.com/omgovich/colord/tree/master/src/plugins) |
| Library | <nobr>Operations/sec</nobr> | Size<br /> (minified) | Size<br /> (gzipped) |
|--------------------------------------------------------------------|------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <nobr><b>[color-2-name](#color-2-name) v1.3.2 🚀</b></nobr> | <nobr>🟢 <b>7 516 ops/s,</b> ±0.55%%</nobr> | [![color-2-name](https://snyk.io/advisor/npm-package/color-2-name/badge.svg)](https://snyk.io/advisor/npm-package/color-2-name) | [![](https://badgen.net/bundlephobia/minzip/color-2-name?color=yellow&label=)](https://bundlephobia.com/result?p=color-2-name) |
| <nobr>[colord](https://www.npmjs.com/package/colord) v2.9.3</nobr> | <nobr>🔴 736 ops/s, ±0.29% ( 90.21%% slower)</nobr> | [![colord](https://snyk.io/advisor/npm-package/colord/badge.svg)](https://snyk.io/advisor/npm-package/colord) | [![](https://badgen.net/bundlephobia/minzip/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) + [plugins](https://github.com/omgovich/colord/tree/master/src/plugins) |

- The performance results were generated on a common Intel i5 by running `npm run benchmark` in the library folder. See [tests/benchmark.test.ts](https://github.com/wp-blocks/color-2-name/blob/main/tests/bench/benchmark.ts).
- For the test we are generating 50 random colors to make sure that no internal mechanism is benefited
Expand Down
Loading
Loading