This commit is contained in:
Victor Giers
2019-06-08 04:21:27 +02:00
parent 92197adbcd
commit 5c913ebcaf
9 changed files with 1306 additions and 992 deletions

View File

@@ -166,15 +166,8 @@ function initFullScreen() {
}
function prepareExternalInterface(app) {
// register functions in the app.ExternalInterface to call them from Puzzles, e.g:
// app.ExternalInterface.myJSFunction = function() {
// console.log('Hello, World!');
// }
app.ExternalInterface.HSVtoRGB = function(h, s, v) {
var r, g, b, i, f, p, q, t;
if (arguments.length === 1) {
s = h.s, v = h.v, h = h.h;
}
i = Math.floor(h * 6);
f = h * 6 - i;
p = v * (1 - s);
@@ -188,14 +181,11 @@ function prepareExternalInterface(app) {
case 4: r = t, g = p, b = v; break;
case 5: r = v, g = p, b = q; break;
}
console.log(r,g,b);
app.ExternalInterface.setRGB(r, g, b);
return {
r: Math.round(r * 255),
g: Math.round(g * 255),
b: Math.round(b * 255)
};
}
}
function runCode(app) {