Remove legacy Color constructors.

This commit is contained in:
Jürg Lehni 2015-09-06 15:28:46 +02:00
parent 4ccb53ac68
commit 824b0c7e7e
2 changed files with 3 additions and 23 deletions

View file

@ -191,9 +191,9 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
* objects.
*
* <b>Please note:</b> Using this method may override native constructors
* (e.g. Path, RGBColor). This may cause problems when using Paper.js in
* conjunction with other libraries that rely on these constructors. Keep
* the library scoped if you encounter issues caused by this.
* (e.g. Path). This may cause problems when using Paper.js in conjunction
* with other libraries that rely on these constructors. Keep the library
* scoped if you encounter issues caused by this.
*
* @example
* paper.install(window);

View file

@ -1283,23 +1283,3 @@ var Color = Base.extend(new function() {
*/
});
});
// Expose Color.RGB, etc. constructors, as well as RgbColor, RGBColor, etc.for
// backward compatibility.
Base.each(Color._types, function(properties, type) {
var ctor = this[Base.capitalize(type) + 'Color'] = function(arg) {
var argType = arg != null && typeof arg,
components = argType === 'object' && arg.length != null
? arg
: argType === 'string'
? null
: arguments;
return components
? new Color(type, components)
: new Color(arg);
};
if (type.length == 3) {
var acronym = type.toUpperCase();
Color[acronym] = this[acronym + 'Color'] = ctor;
}
}, Base.exports);