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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 /** | 152 /** |
153 * @param {!Event} event | 153 * @param {!Event} event |
154 * @this {WebInspector.Spectrum} | 154 * @this {WebInspector.Spectrum} |
155 */ | 155 */ |
156 function positionAlpha(event) | 156 function positionAlpha(event) |
157 { | 157 { |
158 var newAlpha = Math.round((event.x - this._hueAlphaLeft) / this._hueAlph
aWidth * 100) / 100; | 158 var newAlpha = Math.round((event.x - this._hueAlphaLeft) / this._hueAlph
aWidth * 100) / 100; |
159 var hsva = this._hsv.slice(); | 159 var hsva = this._hsv.slice(); |
160 hsva[3] = Number.constrain(newAlpha, 0, 1); | 160 hsva[3] = Number.constrain(newAlpha, 0, 1); |
161 var colorFormat = undefined; | 161 var colorFormat = undefined; |
162 if (this._color().hasAlpha() && (this._colorFormat === WebInspector.Colo
r.Format.ShortHEX || this._colorFormat === WebInspector.Color.Format.HEX || this
._colorFormat === WebInspector.Color.Format.Nickname)) | 162 if (hsva[3] !== 1 && (this._colorFormat === WebInspector.Color.Format.Sh
ortHEX || this._colorFormat === WebInspector.Color.Format.HEX || this._colorForm
at === WebInspector.Color.Format.Nickname)) |
163 colorFormat = WebInspector.Color.Format.RGB; | 163 colorFormat = WebInspector.Color.Format.RGB; |
164 this._innerSetColor(hsva, "", colorFormat, WebInspector.Spectrum._Change
Source.Other); | 164 this._innerSetColor(hsva, "", colorFormat, WebInspector.Spectrum._Change
Source.Other); |
165 } | 165 } |
166 | 166 |
167 /** | 167 /** |
168 * @param {!Event} event | 168 * @param {!Event} event |
169 * @this {WebInspector.Spectrum} | 169 * @this {WebInspector.Spectrum} |
170 */ | 170 */ |
171 function positionColor(event) | 171 function positionColor(event) |
172 { | 172 { |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 "#8BC34A", | 894 "#8BC34A", |
895 "#CDDC39", | 895 "#CDDC39", |
896 "#FFEB3B", | 896 "#FFEB3B", |
897 "#FFC107", | 897 "#FFC107", |
898 "#FF9800", | 898 "#FF9800", |
899 "#FF5722", | 899 "#FF5722", |
900 "#795548", | 900 "#795548", |
901 "#9E9E9E", | 901 "#9E9E9E", |
902 "#607D8B" | 902 "#607D8B" |
903 ]}; | 903 ]}; |
OLD | NEW |