Fix : dont modify transparent color

This commit is contained in:
jdescottes
2014-05-20 22:42:39 +02:00
parent 93f3526f4b
commit da9cd78b56
3 changed files with 24 additions and 11 deletions

View File

@@ -41,6 +41,14 @@ if (typeof Function.prototype.bind !== "function") {
return ((r << 16) | (g << 8) | b).toString(16);
};
ns.normalize = function (value, def) {
if (typeof value === 'undefined' || value === null) {
return def;
} else {
return value;
}
};
ns.inherit = function(extendedObject, inheritFrom) {
extendedObject.prototype = Object.create(inheritFrom.prototype);
extendedObject.prototype.constructor = extendedObject;