forked from color-js/color.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangles.js
45 lines (44 loc) · 941 Bytes
/
angles.js
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
43
44
45
import {adjust} from "../src/angles.js";
import * as check from "../node_modules/htest.dev/src/check.js";
export default {
name: "Angle pre-interpolation adjustment tests",
description: "These tests test how angles adapt to different hue interpolation strategies.",
run: adjust,
check: check.deep(check.proximity({epsilon: .0005})),
tests: [
{
args: [undefined, [-20, 380]],
expect: [340, 20],
},
{
args: ["increasing", [-20, 380]],
expect: [340, 380],
},
{
args: ["decreasing", [-20, 380]],
expect: [340, 20],
},
{
args: ["longer", [-20, 380]],
expect: [340, 20],
},
{
args: ["shorter", [-20, 380]],
expect: [340, 380],
},
{
args: ["raw", [-20, 380]],
expect: [-20, 380],
},
{
name: "Longer and Undefined",
args: ["longer", [90, null]],
expect: [90, 450],
},
{
name: "Longer and Same Hues",
args: ["longer", [90, 90]],
expect: [90, 450],
},
],
};