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

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

Issue 1986053004: Devtools Color: Basic support for #RRGGBBAA and #RGBA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 a9a6bf22679ab17c82bd9d0ddb6a35dbdf038c14..96de2b964dec8ab3941a39a38f190b58491ad3dc 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
@@ -118,9 +118,8 @@ WebInspector.ColorSwatch._nextColorFormat = function(color, curFormat)
// * rgb(a)
// * hsl(a)
// * nickname (if the color has a nickname)
- // * if the color is simple:
- // - shorthex (if has short hex)
- // - hex
+ // * shorthex (if has short hex)
+ // * hex
var cf = WebInspector.Color.Format;
switch (curFormat) {
@@ -135,22 +134,20 @@ WebInspector.ColorSwatch._nextColorFormat = function(color, curFormat)
case cf.HSLA:
if (color.nickname())
return cf.Nickname;
- if (!color.hasAlpha())
- return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
- else
- return cf.Original;
+ return color.detectHEXFormat();
case cf.ShortHEX:
return cf.HEX;
+ case cf.ShortHEXA:
+ return cf.HEXA;
+
+ case cf.HEXA:
case cf.HEX:
return cf.Original;
case cf.Nickname:
- if (!color.hasAlpha())
- return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
- else
- return cf.Original;
+ return color.detectHEXFormat();
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