OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Brian Grinstead All rights reserved. | 2 * Copyright (C) 2011 Brian Grinstead All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 var slideY = this.slideHeight - ((h * this.slideHeight) + this.slideHelp
erHeight); | 291 var slideY = this.slideHeight - ((h * this.slideHeight) + this.slideHelp
erHeight); |
292 this.slideHelper.style.top = slideY + "px"; | 292 this.slideHelper.style.top = slideY + "px"; |
293 | 293 |
294 this._alphaElement.value = this._hsv[3] * 100; | 294 this._alphaElement.value = this._hsv[3] * 100; |
295 }, | 295 }, |
296 | 296 |
297 _updateUI: function() | 297 _updateUI: function() |
298 { | 298 { |
299 this._updateHelperLocations(); | 299 this._updateHelperLocations(); |
300 | 300 |
301 this._draggerElement.style.backgroundColor = WebInspector.Color.fromHSVA
([this._hsv[0], 1, 1, 1]).toString(WebInspector.Color.Format.RGB); | 301 this._draggerElement.style.backgroundColor = /** @type {string} */ (WebI
nspector.Color.fromHSVA([this._hsv[0], 1, 1, 1]).toString(WebInspector.Color.For
mat.RGB)); |
302 this._swatchInnerElement.style.backgroundColor = this.color().toString(W
ebInspector.Color.Format.RGBA); | 302 this._swatchInnerElement.style.backgroundColor = /** @type {string} */ (
this.color().toString(WebInspector.Color.Format.RGBA)); |
303 | 303 |
304 this._alphaElement.value = this._hsv[3] * 100; | 304 this._alphaElement.value = this._hsv[3] * 100; |
305 }, | 305 }, |
306 | 306 |
307 wasShown: function() | 307 wasShown: function() |
308 { | 308 { |
309 this.slideHeight = this._sliderElement.offsetHeight; | 309 this.slideHeight = this._sliderElement.offsetHeight; |
310 this.dragWidth = this._draggerElement.offsetWidth; | 310 this.dragWidth = this._draggerElement.offsetWidth; |
311 this.dragHeight = this._draggerElement.offsetHeight; | 311 this.dragHeight = this._draggerElement.offsetHeight; |
312 this._dragHelperElementHeight = this._dragHelperElement.offsetHeight / 2
; | 312 this._dragHelperElementHeight = this._dragHelperElement.offsetHeight / 2
; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 444 |
445 WebInspector.ColorSwatch.prototype = { | 445 WebInspector.ColorSwatch.prototype = { |
446 /** | 446 /** |
447 * @param {string} colorString | 447 * @param {string} colorString |
448 */ | 448 */ |
449 setColorString: function(colorString) | 449 setColorString: function(colorString) |
450 { | 450 { |
451 this._swatchInnerElement.style.backgroundColor = colorString; | 451 this._swatchInnerElement.style.backgroundColor = colorString; |
452 } | 452 } |
453 } | 453 } |
OLD | NEW |