mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Remove legacy Color constructors.
This commit is contained in:
parent
4ccb53ac68
commit
824b0c7e7e
2 changed files with 3 additions and 23 deletions
|
@ -191,9 +191,9 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
|
||||||
* objects.
|
* objects.
|
||||||
*
|
*
|
||||||
* <b>Please note:</b> Using this method may override native constructors
|
* <b>Please note:</b> Using this method may override native constructors
|
||||||
* (e.g. Path, RGBColor). This may cause problems when using Paper.js in
|
* (e.g. Path). This may cause problems when using Paper.js in conjunction
|
||||||
* conjunction with other libraries that rely on these constructors. Keep
|
* with other libraries that rely on these constructors. Keep the library
|
||||||
* the library scoped if you encounter issues caused by this.
|
* scoped if you encounter issues caused by this.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* paper.install(window);
|
* paper.install(window);
|
||||||
|
|
|
@ -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);
|
|
||||||
|
|
Loading…
Reference in a new issue