yeelight-awesome
Version:
The node.js client api to control yeelight device over WIFI
25 lines • 832 B
JavaScript
;
exports.__esModule = true;
exports.Color = void 0;
var utils_1 = require("../utils");
var Color = /** @class */ (function () {
function Color(red, green, blue, color) {
this.red = red;
this.green = green;
this.blue = blue;
this.color = color;
if (color) {
this.color = color.toUpperCase();
this.red = utils_1.Utils.hexToNumber(color.substr(0, 2));
this.green = utils_1.Utils.hexToNumber(color.substr(2, 2));
this.blue = utils_1.Utils.hexToNumber(color.substr(4, 2));
}
}
Color.prototype.getValue = function () {
// tslint:disable-next-line:no-bitwise
return this.red * 65536 + this.green * 256 + this.blue;
};
return Color;
}());
exports.Color = Color;
//# sourceMappingURL=color.js.map