@ginden/blinkstick-v2
Version:
Improved Blickstick API for Node.js
25 lines • 808 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleFrame = void 0;
const utils_1 = require("../../utils");
/**
* SimpleFrame represents a single frame of animation with a specific color and duration.
* @category Animation
*/
class SimpleFrame {
static fromProperties(props) {
return new SimpleFrame(props.rgb, props.duration | 0);
}
static colorAndDuration(color, duration) {
return new SimpleFrame((0, utils_1.colorInputToRgbTuple)(color), duration | 0);
}
constructor(rgb, duration) {
this.rgb = rgb;
this.duration = duration | 0;
}
toString() {
return `SimpleFrame([${this.rgb.join(', ')}], ${this.duration})`;
}
}
exports.SimpleFrame = SimpleFrame;
//# sourceMappingURL=simple-frame.js.map