Guest User

Untitled

a guest
Jan 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. flashlight(color: String, time: any): Promise<any> {
  2. return new Promise(resolve => {
  3. setTimeout(function() {
  4. // this.drawLight(color);
  5. const c: any = document.getElementById('flashlight');
  6. const ctx = c.getContext('2d');
  7. ctx.beginPath();
  8. ctx.arc(c.width / 2, c.height - 50, 50, 0, 2 * Math.PI);
  9. ctx.fillStyle = color;
  10. ctx.fill();
  11. ctx.stroke();
  12. resolve(true);
  13. }, time);
  14. });
  15. }
Add Comment
Please, Sign In to add comment