gn8
This commit is contained in:
16
qubeenee.js
16
qubeenee.js
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user