From 824b0c7e7ea50363b25dcae6d898f3628aeb2eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 6 Sep 2015 15:28:46 +0200 Subject: [PATCH] Remove legacy Color constructors. --- src/core/PaperScope.js | 6 +++--- src/style/Color.js | 20 -------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/core/PaperScope.js b/src/core/PaperScope.js index 81f14524..9fd0cfb6 100644 --- a/src/core/PaperScope.js +++ b/src/core/PaperScope.js @@ -191,9 +191,9 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{ * objects. * * Please note: 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); diff --git a/src/style/Color.js b/src/style/Color.js index 056a865b..3e1155f2 100644 --- a/src/style/Color.js +++ b/src/style/Color.js @@ -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);