@reskit/color
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

Install

Install @reskit/color by pnpm

pnpm add @reskit/color

Usage

import { extractImageColor, extractImageColorInRust } from "@reskit/color";

const imageLink = "https://avatars.githubusercontent.com/u/38021707?v=4";

extractImageColorInRust(imageLink, 5);
extractImageColor(imageLink, 5);

We will extract the top five color at this image.

Sample codes are at ExtractImageColor

We support extract color at rust code which has higher performance.

Functions

Extract color at text.

Extract Hex

import { extractColor } from "@reskit/color";

extractColor("Color is #5c2b2b");

will extract: ["#5c2b2b"]

Extract RGB AND HSL

import { extractColor } from "@reskit/color";

extractColor("Color is rgb(62, 33, 33) and hsl(0, 1%, 66%)");

will extract: ["rgb(62, 33, 33)", "hsl(0, 1%, 66%)"]

Extract RGBA AND HSLA

import { extractColor } from "@reskit/color";

extractColor("Color is rgba(62, 33, 33, 0.3) and hsla(0, 30.50%, 18.60%, 0.30)");

will extract: ["rgba(62, 33, 33, 0.3)", "hsla(0, 30.50%, 18.60%, 0.30)"]

Others

Welcome to contribute and make @reskit/color better!

Package Sidebar

Install

npm i @reskit/color

Weekly Downloads

2

Version

1.3.1

License

Apache-2.0

Unpacked Size

30.7 kB

Total Files

9

Last publish

Collaborators

  • simumn