Skip to content

Commit

Permalink
- Removed private properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
elusivecodes committed May 3, 2023
1 parent e26bdd6 commit 892d473
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 30 deletions.
21 changes: 8 additions & 13 deletions dist/frost-color.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/frost-color.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frost-color.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frost-color.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fr0st/color",
"version": "4.0.1",
"version": "4.0.2",
"description": "FrostColor is a free, open-source color manipulation library for JavaScript.",
"keywords": [
"color",
Expand Down
21 changes: 8 additions & 13 deletions src/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import { clamp, round } from './helpers.js';
* @class
*/
export default class Color {
#r;
#g;
#b;
#a;

/**
* New Color constructor.
* @param {number} [r=0] The red value, or the brightness value.
Expand All @@ -24,10 +19,10 @@ export default class Color {
b = g = r = round(r * 2.55);
}

this.#r = clamp(r, 0, 255);
this.#g = clamp(g, 0, 255);
this.#b = clamp(b, 0, 255);
this.#a = clamp(a, 0, 1);
this._r = clamp(r, 0, 255);
this._g = clamp(g, 0, 255);
this._b = clamp(b, 0, 255);
this._a = clamp(a, 0, 1);
}

/**
Expand All @@ -54,30 +49,30 @@ export default class Color {
* @return {number} The alpha value. (0, 1)
*/
get a() {
return this.#a;
return this._a;
}

/**
* Get the blue value of the color.
* @return {number} The blue value. (0, 255)
*/
get b() {
return this.#b;
return this._b;
}

/**
* Get the green value of the color.
* @return {number} The green value. (0, 255)
*/
get g() {
return this.#g;
return this._g;
}

/**
* Get the red value of the color.
* @return {number} The red value. (0, 255)
*/
get r() {
return this.#r;
return this._r;
}
}

0 comments on commit 892d473

Please sign in to comment.