add grunt.js, update color libraries
parent
0560bae4f5
commit
112fc7a688
14
build.sh
14
build.sh
|
@ -1,14 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p build
|
||||
OUT=build/MIDI.minimal.js
|
||||
|
||||
echo "//MIDI.js minimal Browserify wrapper" > $OUT
|
||||
|
||||
for file in js/DOMLoader.*.js js/Polyfill/Base64.js inc/base64binary.js js/MIDI.*.js
|
||||
do
|
||||
cat $file >> $OUT
|
||||
echo "" >> $OUT
|
||||
done
|
||||
|
||||
echo "if (typeof module !== 'undefined') module.exports = MIDI;" >> $OUT
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
Build environment
|
||||
----------------------------------------
|
||||
1) Install NodeJS:
|
||||
http://nodejs.org/
|
||||
2) Install Grunt
|
||||
npm install grunt
|
||||
*/
|
||||
|
||||
module.exports = function (grunt) {
|
||||
grunt.initConfig({
|
||||
concat: {
|
||||
'build/MIDI.js': "./js/**"
|
||||
},
|
||||
min: {
|
||||
'build/MIDI.min.js': ['build/MIDI.js']
|
||||
}
|
||||
});
|
||||
///
|
||||
grunt.registerTask('default', 'concat min');
|
||||
///
|
||||
};
|
|
@ -1,6 +1,8 @@
|
|||
/*
|
||||
----------------------------------------------------
|
||||
Color Space : 1.2 : 2012.09.01 : http://mudcu.be
|
||||
Color Space : 1.2 : 2012.11.06
|
||||
----------------------------------------------------
|
||||
https://github.com/mudcube/Color.Space.js
|
||||
----------------------------------------------------
|
||||
RGBA <-> HSLA <-> W3
|
||||
RGBA <-> HSVA
|
||||
|
@ -25,14 +27,17 @@
|
|||
#000000
|
||||
*/
|
||||
|
||||
if (typeof(Color) === "undefined") Color = {};
|
||||
if (typeof(Color) === "undefined") var Color = {};
|
||||
if (typeof(Color.Space) === "undefined") Color.Space = {};
|
||||
|
||||
(function () { "use strict";
|
||||
|
||||
var useEval = false; // caches functions for quicker access.
|
||||
|
||||
var functions = {
|
||||
// holds generated cached conversion functions.
|
||||
};
|
||||
|
||||
var shortcuts = {
|
||||
"HEX24>HSL": "HEX24>RGB>HSL",
|
||||
"HEX32>HSLA": "HEX32>RGBA>HSLA",
|
||||
|
@ -65,9 +70,13 @@ var root = Color.Space = function(color, route) {
|
|||
}
|
||||
key += (pos === 0 ? "" : "_") + r[pos];
|
||||
color = root[key](color);
|
||||
// f = "Color.Space."+key+"("+f+")";
|
||||
if (useEval) {
|
||||
f = "Color.Space."+key+"("+f+")";
|
||||
}
|
||||
}
|
||||
// functions[route] = eval("(function(color) { return "+f+" })");
|
||||
if (useEval) {
|
||||
functions[route] = eval("(function(color) { return "+f+" })");
|
||||
}
|
||||
return color;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue