author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2012-03-17 21:08:23 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2012-03-17 21:08:23 (UTC) |
commit | 928f3f3ed3981f7f81b69ed94f2a315205db39fa (patch) (unidiff) | |
tree | 8a47229b56e4c906de8512baf0c5ca100bc03dfb /frontend/gamma/js/MochiKit/Color.js | |
parent | bf7d8191a3a6dbd092a88911098a3e7f6cf30cf7 (diff) | |
download | clipperz-928f3f3ed3981f7f81b69ed94f2a315205db39fa.zip clipperz-928f3f3ed3981f7f81b69ed94f2a315205db39fa.tar.gz clipperz-928f3f3ed3981f7f81b69ed94f2a315205db39fa.tar.bz2 |
Fixed frontend properties and updated MochiKit version
Diffstat (limited to 'frontend/gamma/js/MochiKit/Color.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/MochiKit/Color.js | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/frontend/gamma/js/MochiKit/Color.js b/frontend/gamma/js/MochiKit/Color.js index 27dc2d0..f2a0f67 100644 --- a/frontend/gamma/js/MochiKit/Color.js +++ b/frontend/gamma/js/MochiKit/Color.js | |||
@@ -7,9 +7,9 @@ See <http://mochikit.com/> for documentation, downloads, license, etc. | |||
7 | (c) 2005 Bob Ippolito and others. All rights Reserved. | 7 | (c) 2005 Bob Ippolito and others. All rights Reserved. |
8 | 8 | ||
9 | ***/ | 9 | ***/ |
10 | 10 | ||
11 | MochiKit.Base._module('Color', '1.5', ['Base', 'DOM', 'Style']); | 11 | MochiKit.Base.module(MochiKit, 'Color', '1.5', ['Base', 'DOM', 'Style']); |
12 | 12 | ||
13 | /** @id MochiKit.Color.Color */ | 13 | /** @id MochiKit.Color.Color */ |
14 | MochiKit.Color.Color = function (red, green, blue, alpha) { | 14 | MochiKit.Color.Color = function (red, green, blue, alpha) { |
15 | if (typeof(alpha) == 'undefined' || alpha === null) { | 15 | if (typeof(alpha) == 'undefined' || alpha === null) { |
@@ -111,9 +111,9 @@ MochiKit.Color.Color.prototype = { | |||
111 | }, | 111 | }, |
112 | 112 | ||
113 | /** @id MochiKit.Color.Color.prototype.isLight */ | 113 | /** @id MochiKit.Color.Color.prototype.isLight */ |
114 | isLight: function () { | 114 | isLight: function () { |
115 | return this.asHSL().b > 0.5; | 115 | return this.asHSL().l > 0.5; |
116 | }, | 116 | }, |
117 | 117 | ||
118 | /** @id MochiKit.Color.Color.prototype.isDark */ | 118 | /** @id MochiKit.Color.Color.prototype.isDark */ |
119 | isDark: function () { | 119 | isDark: function () { |
@@ -640,21 +640,12 @@ MochiKit.Base.update(MochiKit.Color, { | |||
640 | /** @id MochiKit.Color.yellowColor */ | 640 | /** @id MochiKit.Color.yellowColor */ |
641 | yellow: [1, 1, 0] | 641 | yellow: [1, 1, 0] |
642 | }; | 642 | }; |
643 | 643 | ||
644 | var makeColor = function (name, r, g, b, a) { | ||
645 | var rval = this.fromRGB(r, g, b, a); | ||
646 | this[name] = function () { return rval; }; | ||
647 | return rval; | ||
648 | }; | ||
649 | |||
650 | for (var k in colors) { | 644 | for (var k in colors) { |
651 | var name = k + "Color"; | 645 | var name = k + "Color"; |
652 | var bindArgs = m.concat( | 646 | var value = this.Color.fromRGB.apply(this.Color, colors[k]); |
653 | [makeColor, this.Color, name], | 647 | this.Color[name] = m.partial(m.operator.identity, value); |
654 | colors[k] | ||
655 | ); | ||
656 | this.Color[name] = m.bind.apply(null, bindArgs); | ||
657 | } | 648 | } |
658 | 649 | ||
659 | var isColor = function () { | 650 | var isColor = function () { |
660 | for (var i = 0; i < arguments.length; i++) { | 651 | for (var i = 0; i < arguments.length; i++) { |