| 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;
|
|
|