Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js

Issue 2186773002: Revert of Devtools Color: Basic support for #RRGGBBAA and #RGBA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Manual revert Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {HTMLSpanElement} 7 * @extends {HTMLSpanElement}
8 */ 8 */
9 WebInspector.ColorSwatch = function() 9 WebInspector.ColorSwatch = function()
10 { 10 {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return !color.hasAlpha() ? cf.RGB : cf.RGBA; 135 return !color.hasAlpha() ? cf.RGB : cf.RGBA;
136 136
137 case cf.RGB: 137 case cf.RGB:
138 case cf.RGBA: 138 case cf.RGBA:
139 return !color.hasAlpha() ? cf.HSL : cf.HSLA; 139 return !color.hasAlpha() ? cf.HSL : cf.HSLA;
140 140
141 case cf.HSL: 141 case cf.HSL:
142 case cf.HSLA: 142 case cf.HSLA:
143 if (color.nickname()) 143 if (color.nickname())
144 return cf.Nickname; 144 return cf.Nickname;
145 return color.detectHEXFormat(); 145 if (!color.hasAlpha())
146 return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
147 else
148 return cf.Original;
146 149
147 case cf.ShortHEX: 150 case cf.ShortHEX:
148 return cf.HEX; 151 return cf.HEX;
149 152
150 case cf.ShortHEXA:
151 return cf.HEXA;
152
153 case cf.HEXA:
154 case cf.HEX: 153 case cf.HEX:
155 return cf.Original; 154 return cf.Original;
156 155
157 case cf.Nickname: 156 case cf.Nickname:
158 return color.detectHEXFormat(); 157 if (!color.hasAlpha())
158 return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
159 else
160 return cf.Original;
159 161
160 default: 162 default:
161 return cf.RGBA; 163 return cf.RGBA;
162 } 164 }
163 } 165 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698