rock-mod
Version:
Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.
35 lines (34 loc) • 795 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RGBA = void 0;
const Math_1 = require("../math/Math");
class RGBA {
static _minColorValue = 0;
static _maxColorValue = 255;
_r;
_g;
_b;
_a;
get r() {
return this._r;
}
get g() {
return this._g;
}
get b() {
return this._b;
}
get a() {
return this._a;
}
constructor(r, g, b, a) {
this._r = RGBA._clampColor(r);
this._g = RGBA._clampColor(g);
this._b = RGBA._clampColor(b);
this._a = a !== undefined ? RGBA._clampColor(a) : undefined;
}
static _clampColor(value) {
return (0, Math_1.MathClamp)(value, RGBA._minColorValue, RGBA._maxColorValue);
}
}
exports.RGBA = RGBA;