Skip to content

Commit 892d473

Browse files
committed
- Removed private properties.
1 parent e26bdd6 commit 892d473

File tree

6 files changed

+20
-30
lines changed

6 files changed

+20
-30
lines changed

dist/frost-color.js

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

dist/frost-color.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/frost-color.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/frost-color.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fr0st/color",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"description": "FrostColor is a free, open-source color manipulation library for JavaScript.",
55
"keywords": [
66
"color",

src/color.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ import { clamp, round } from './helpers.js';
66
* @class
77
*/
88
export default class Color {
9-
#r;
10-
#g;
11-
#b;
12-
#a;
13-
149
/**
1510
* New Color constructor.
1611
* @param {number} [r=0] The red value, or the brightness value.
@@ -24,10 +19,10 @@ export default class Color {
2419
b = g = r = round(r * 2.55);
2520
}
2621

27-
this.#r = clamp(r, 0, 255);
28-
this.#g = clamp(g, 0, 255);
29-
this.#b = clamp(b, 0, 255);
30-
this.#a = clamp(a, 0, 1);
22+
this._r = clamp(r, 0, 255);
23+
this._g = clamp(g, 0, 255);
24+
this._b = clamp(b, 0, 255);
25+
this._a = clamp(a, 0, 1);
3126
}
3227

3328
/**
@@ -54,30 +49,30 @@ export default class Color {
5449
* @return {number} The alpha value. (0, 1)
5550
*/
5651
get a() {
57-
return this.#a;
52+
return this._a;
5853
}
5954

6055
/**
6156
* Get the blue value of the color.
6257
* @return {number} The blue value. (0, 255)
6358
*/
6459
get b() {
65-
return this.#b;
60+
return this._b;
6661
}
6762

6863
/**
6964
* Get the green value of the color.
7065
* @return {number} The green value. (0, 255)
7166
*/
7267
get g() {
73-
return this.#g;
68+
return this._g;
7469
}
7570

7671
/**
7772
* Get the red value of the color.
7873
* @return {number} The red value. (0, 255)
7974
*/
8075
get r() {
81-
return this.#r;
76+
return this._r;
8277
}
8378
}

0 commit comments

Comments
 (0)