Skip to content

Commit 305fab4

Browse files
committed
- Updated NPM.
- Fixed lint issues.
1 parent 6082448 commit 305fab4

File tree

13 files changed

+1572
-1526
lines changed

13 files changed

+1572
-1526
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

eslint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import frostConfig from '@fr0st/eslint-config';
2+
3+
export default [
4+
frostConfig
5+
];

package-lock.json

Lines changed: 342 additions & 246 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fr0st/color",
3-
"version": "4.1.4",
3+
"version": "4.1.5",
44
"description": "FrostColor is a free, open-source color manipulation library for JavaScript.",
55
"keywords": [
66
"color",
@@ -28,7 +28,7 @@
2828
"scripts": {
2929
"build": "npm run js-compile && npm run js-minify",
3030
"js-compile": "rollup --config",
31-
"js-lint": "eslint --ext .js .",
31+
"js-lint": "eslint",
3232
"js-minify": "terser --compress passes=2 --mangle --source-map \"content=dist/frost-color.js.map\" --output dist/frost-color.min.js dist/frost-color.js",
3333
"test": "mocha --recursive"
3434
},
@@ -40,10 +40,10 @@
4040
"license": "MIT",
4141
"private": false,
4242
"devDependencies": {
43-
"eslint": "^8.54.0",
44-
"eslint-config-google": "^0.14.0",
45-
"mocha": "^10.2.0",
46-
"rollup": "^4.6.0",
47-
"terser": "^5.24.0"
43+
"@fr0st/eslint-config": "^1.0.0",
44+
"eslint": "^9.5.0",
45+
"mocha": "^10.4.0",
46+
"rollup": "^4.18.0",
47+
"terser": "^5.31.1"
4848
}
4949
}

test/attributes.js

Lines changed: 114 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,114 @@
1-
import assert from 'node:assert/strict';
2-
import Color from './../src/index.js';
3-
4-
describe('Color Attributes', function() {
5-
6-
describe('#getAlpha', function() {
7-
it('returns the alpha value', function() {
8-
assert.strictEqual(
9-
new Color(0, 0, 0, .75)
10-
.getAlpha(),
11-
.75
12-
);
13-
});
14-
});
15-
16-
describe('#getBrightness', function() {
17-
it('returns the brightness value', function() {
18-
assert.strictEqual(
19-
Color.fromHSV(180, 50, 75)
20-
.getBrightness(),
21-
75
22-
);
23-
});
24-
});
25-
26-
describe('#getHue', function() {
27-
it('returns the hue value', function() {
28-
assert.strictEqual(
29-
Color.fromHSV(270, 50, 50)
30-
.getHue(),
31-
270
32-
);
33-
});
34-
});
35-
36-
describe('#getSaturation', function() {
37-
it('returns the saturation value', function() {
38-
assert.strictEqual(
39-
Color.fromHSV(180, 25, 50)
40-
.getSaturation(),
41-
25
42-
);
43-
});
44-
});
45-
46-
describe('#luma', function() {
47-
it('returns the relative luma value', function() {
48-
assert.strictEqual(
49-
Color.fromHSV(180, 50, 50)
50-
.luma(),
51-
.17935225036098287
52-
);
53-
});
54-
});
55-
56-
describe('#setAlpha', function() {
57-
it('sets the alpha value', function() {
58-
const color1 = Color.fromHSV(120, 50, 50);
59-
const color2 = color1.setAlpha(.75);
60-
assert.strictEqual(
61-
color1.getAlpha(),
62-
1
63-
);
64-
assert.strictEqual(
65-
color2.getAlpha(),
66-
.75
67-
);
68-
});
69-
});
70-
71-
describe('#setBrightness', function() {
72-
it('sets the brightness value', function() {
73-
const color1 = Color.fromHSV(180, 50, 50);
74-
const color2 = color1.setBrightness(75);
75-
assert.strictEqual(
76-
color1.getBrightness(),
77-
50
78-
);
79-
assert.strictEqual(
80-
color2.getBrightness(),
81-
75
82-
);
83-
});
84-
});
85-
86-
describe('#setHue', function() {
87-
it('sets the hue value', function() {
88-
const color1 = Color.fromHSV(180, 50, 50);
89-
const color2 = color1.setHue(270);
90-
assert.strictEqual(
91-
color1.getHue(),
92-
180
93-
);
94-
assert.strictEqual(
95-
color2.getHue(),
96-
270
97-
);
98-
});
99-
});
100-
101-
describe('#setSaturation', function() {
102-
it('sets the saturation value', function() {
103-
const color1 = Color.fromHSV(180, 50, 50);
104-
const color2 = color1.setSaturation(25);
105-
assert.strictEqual(
106-
color1.getSaturation(),
107-
50
108-
);
109-
assert.strictEqual(
110-
color2.getSaturation(),
111-
25
112-
);
113-
});
114-
});
115-
116-
});
1+
import assert from 'node:assert/strict';
2+
import Color from './../src/index.js';
3+
4+
describe('Color Attributes', function() {
5+
describe('#getAlpha', function() {
6+
it('returns the alpha value', function() {
7+
assert.strictEqual(
8+
new Color(0, 0, 0, .75)
9+
.getAlpha(),
10+
.75,
11+
);
12+
});
13+
});
14+
15+
describe('#getBrightness', function() {
16+
it('returns the brightness value', function() {
17+
assert.strictEqual(
18+
Color.fromHSV(180, 50, 75)
19+
.getBrightness(),
20+
75,
21+
);
22+
});
23+
});
24+
25+
describe('#getHue', function() {
26+
it('returns the hue value', function() {
27+
assert.strictEqual(
28+
Color.fromHSV(270, 50, 50)
29+
.getHue(),
30+
270,
31+
);
32+
});
33+
});
34+
35+
describe('#getSaturation', function() {
36+
it('returns the saturation value', function() {
37+
assert.strictEqual(
38+
Color.fromHSV(180, 25, 50)
39+
.getSaturation(),
40+
25,
41+
);
42+
});
43+
});
44+
45+
describe('#luma', function() {
46+
it('returns the relative luma value', function() {
47+
assert.strictEqual(
48+
Color.fromHSV(180, 50, 50)
49+
.luma(),
50+
.17935225036098287,
51+
);
52+
});
53+
});
54+
55+
describe('#setAlpha', function() {
56+
it('sets the alpha value', function() {
57+
const color1 = Color.fromHSV(120, 50, 50);
58+
const color2 = color1.setAlpha(.75);
59+
assert.strictEqual(
60+
color1.getAlpha(),
61+
1,
62+
);
63+
assert.strictEqual(
64+
color2.getAlpha(),
65+
.75,
66+
);
67+
});
68+
});
69+
70+
describe('#setBrightness', function() {
71+
it('sets the brightness value', function() {
72+
const color1 = Color.fromHSV(180, 50, 50);
73+
const color2 = color1.setBrightness(75);
74+
assert.strictEqual(
75+
color1.getBrightness(),
76+
50,
77+
);
78+
assert.strictEqual(
79+
color2.getBrightness(),
80+
75,
81+
);
82+
});
83+
});
84+
85+
describe('#setHue', function() {
86+
it('sets the hue value', function() {
87+
const color1 = Color.fromHSV(180, 50, 50);
88+
const color2 = color1.setHue(270);
89+
assert.strictEqual(
90+
color1.getHue(),
91+
180,
92+
);
93+
assert.strictEqual(
94+
color2.getHue(),
95+
270,
96+
);
97+
});
98+
});
99+
100+
describe('#setSaturation', function() {
101+
it('sets the saturation value', function() {
102+
const color1 = Color.fromHSV(180, 50, 50);
103+
const color2 = color1.setSaturation(25);
104+
assert.strictEqual(
105+
color1.getSaturation(),
106+
50,
107+
);
108+
assert.strictEqual(
109+
color2.getSaturation(),
110+
25,
111+
);
112+
});
113+
});
114+
});

0 commit comments

Comments
 (0)