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

Unified 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, 5 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js b/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
index 7fe3f201d98d9d66835626677f29eae88589621a..f35a7cfb36048d9d1e676fc5c6e7d5f093b973cc 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
@@ -142,20 +142,22 @@ WebInspector.ColorSwatch._nextColorFormat = function(color, curFormat)
case cf.HSLA:
if (color.nickname())
return cf.Nickname;
- return color.detectHEXFormat();
+ if (!color.hasAlpha())
+ return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
+ else
+ return cf.Original;
case cf.ShortHEX:
return cf.HEX;
- case cf.ShortHEXA:
- return cf.HEXA;
-
- case cf.HEXA:
case cf.HEX:
return cf.Original;
case cf.Nickname:
- return color.detectHEXFormat();
+ if (!color.hasAlpha())
+ return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
+ else
+ return cf.Original;
default:
return cf.RGBA;
« 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