mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -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.
|
||||
*
|
||||
* <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);
|
||||
|
|
|
@ -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