diff options
author | Yaroslav <contact@yaroslavps.com> | 2019-01-31 20:14:52 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2019-01-31 20:14:52 +0300 |
commit | cc9486b13e028c5ed1ba65bfff30695b4fa48194 (patch) | |
tree | 65a2ebb0d13e90d8ab1c0e2b217cac2fd3721312 /dvd | |
parent | 281deee2c4388d8679fa89a07dd13f9aeae35515 (diff) | |
download | canvas-antics-cc9486b13e028c5ed1ba65bfff30695b4fa48194.tar.gz canvas-antics-cc9486b13e028c5ed1ba65bfff30695b4fa48194.zip |
fix custom colors
Diffstat (limited to 'dvd')
-rw-r--r-- | dvd/dvd.js | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ /* -DVD Screensaver JS v1.0.2 +DVD Screensaver JS v1.0.3 Copyright 2019 Yaroslav de la Peña Smirnov All rights reserved. @@ -48,10 +48,12 @@ function playDVD(options={}){ ]; try{ if(options["colors"].length > 0){ - colors = option["colors"]; + colors = options["colors"]; } } - catch(e){} + catch(e){ + console.log(e) + } var canvas = document.getElementById("dvd"); if(!canvas){ @@ -108,11 +110,9 @@ function playDVD(options={}){ else if(py == 0) direction[1] = 1; // Change the color randomly - if (colors.length > 1){ - ctx.restore(); - ctx.fillStyle = colors[randomRange(0, colors.length+1)]; - ctx.save(); - } + ctx.restore(); + ctx.fillStyle = colors[randomRange(0, colors.length+1)]; + ctx.save(); } function initDVD(){ |