-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
benchmark.ts
42 lines (35 loc) · 820 Bytes
/
benchmark.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* eslint-disable @typescript-eslint/ban-ts-comment */
import b from "benny";
import { colord } from "../src";
// @ts-ignore
import tinycolor2 from "tinycolor2";
// @ts-ignore
import color from "color";
// @ts-ignore
import chroma from "chroma-js";
// @ts-ignore
import AcColor from "ac-colors";
b.suite(
"Parse HEX and convert to HSLA object/array",
b.add("colord", () => {
colord("#808080").toHsl();
}),
b.add("color", () => {
// @ts-ignore
color("#808080").hsl().object();
}),
b.add("tinycolor2", () => {
// @ts-ignore
tinycolor2("#808080").toHsl();
}),
b.add("ac-colors", () => {
// @ts-ignore
new AcColor({ color: "#808080", type: "hex" }).hsl;
}),
b.add("chroma-js", () => {
// @ts-ignore
chroma("#808080").hsl();
}),
b.cycle(),
b.complete()
);