OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 405 |
406 /** | 406 /** |
407 * @param {number} alpha | 407 * @param {number} alpha |
408 * @return {!WebInspector.Color} | 408 * @return {!WebInspector.Color} |
409 */ | 409 */ |
410 setAlpha: function(alpha) | 410 setAlpha: function(alpha) |
411 { | 411 { |
412 var rgba = this._rgba.slice(); | 412 var rgba = this._rgba.slice(); |
413 rgba[3] = alpha; | 413 rgba[3] = alpha; |
414 return new WebInspector.Color(rgba, WebInspector.Color.Format.RGBA); | 414 return new WebInspector.Color(rgba, WebInspector.Color.Format.RGBA); |
415 } | 415 }, |
| 416 |
| 417 equals: function(other) |
| 418 { |
| 419 var myRGBA = this.canonicalRGBA(); |
| 420 var otherRGBA = other.canonicalRGBA(); |
| 421 var result = true; |
| 422 for (var i = 0; i < myRGBA.length; ++i) |
| 423 result = result && (myRGBA[i] === otherRGBA[i]); |
| 424 return result; |
| 425 }, |
416 } | 426 } |
417 | 427 |
418 /** | 428 /** |
419 * @param {string} value | 429 * @param {string} value |
420 * return {number} | 430 * return {number} |
421 */ | 431 */ |
422 WebInspector.Color._parseRgbNumeric = function(value) | 432 WebInspector.Color._parseRgbNumeric = function(value) |
423 { | 433 { |
424 var parsed = parseInt(value, 10); | 434 var parsed = parseInt(value, 10); |
425 if (value.indexOf("%") !== -1) | 435 if (value.indexOf("%") !== -1) |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 Padding: WebInspector.Color.fromRGBA([147, 196, 125, .55]), | 771 Padding: WebInspector.Color.fromRGBA([147, 196, 125, .55]), |
762 PaddingLight: WebInspector.Color.fromRGBA([147, 196, 125, .4]), | 772 PaddingLight: WebInspector.Color.fromRGBA([147, 196, 125, .4]), |
763 Border: WebInspector.Color.fromRGBA([255, 229, 153, .66]), | 773 Border: WebInspector.Color.fromRGBA([255, 229, 153, .66]), |
764 BorderLight: WebInspector.Color.fromRGBA([255, 229, 153, .5]), | 774 BorderLight: WebInspector.Color.fromRGBA([255, 229, 153, .5]), |
765 Margin: WebInspector.Color.fromRGBA([246, 178, 107, .66]), | 775 Margin: WebInspector.Color.fromRGBA([246, 178, 107, .66]), |
766 MarginLight: WebInspector.Color.fromRGBA([246, 178, 107, .5]), | 776 MarginLight: WebInspector.Color.fromRGBA([246, 178, 107, .5]), |
767 EventTarget: WebInspector.Color.fromRGBA([255, 196, 196, .66]), | 777 EventTarget: WebInspector.Color.fromRGBA([255, 196, 196, .66]), |
768 Shape: WebInspector.Color.fromRGBA([96, 82, 177, 0.8]), | 778 Shape: WebInspector.Color.fromRGBA([96, 82, 177, 0.8]), |
769 ShapeMargin: WebInspector.Color.fromRGBA([96, 82, 127, .6]) | 779 ShapeMargin: WebInspector.Color.fromRGBA([96, 82, 127, .6]) |
770 } | 780 } |
OLD | NEW |