aboutsummaryrefslogtreecommitdiffhomepage
path: root/dvd
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2019-01-31 20:14:52 +0300
committerYaroslav <contact@yaroslavps.com>2019-01-31 20:14:52 +0300
commitcc9486b13e028c5ed1ba65bfff30695b4fa48194 (patch)
tree65a2ebb0d13e90d8ab1c0e2b217cac2fd3721312 /dvd
parent281deee2c4388d8679fa89a07dd13f9aeae35515 (diff)
downloadcanvas-antics-cc9486b13e028c5ed1ba65bfff30695b4fa48194.tar.gz
canvas-antics-cc9486b13e028c5ed1ba65bfff30695b4fa48194.zip
fix custom colors
Diffstat (limited to 'dvd')
-rw-r--r--dvd/dvd.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/dvd/dvd.js b/dvd/dvd.js
index d98666f..1e5c822 100644
--- a/dvd/dvd.js
+++ b/dvd/dvd.js
@@ -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(){