In the web inspector in the nightly builds, you can now click on the color swatch to toggle through the various versions of that color. This is great, however, it should remember what state it was left in and all color references should obey that preference when using the inspector in the future.
I have a patch for this coming up.
The design I went with lets you toggle individual colors freely wit hno persistence, but there is now a global setting to pick the default format — Hex, RGB or HSL.
Created attachment 39123 [details] Screen Shot
Created attachment 39124 [details] Proposed Patch
Comment on attachment 39124 [details] Proposed Patch > + swatchElement.title = WebInspector.UIString("Click to change color format."); The new style for tool tips is without a trailing period! > + if (Preferences.colorFormat === "rgb") { > + if (Preferences.showColorNicknames && color.nickname) > + format = "nickname"; > + else > + format = (color.simple ? "rgb" : "rgba"); > + } else if (Preferences.colorFormat === "hsl") { > + if (Preferences.showColorNicknames && color.nickname) > + format = "nickname"; > + else > + format = (color.simple ? "hsl" : "hsla"); > + } else { > + if (Preferences.showColorNicknames && color.nickname) > + format = "nickname"; > + else if (color.simple) > + format = (color.hasShortHex() ? "shorthex" : "hex"); > + else > + format = "rgba"; > + } You can test for the (Preferences.showColorNicknames && color.nickname) condition first instead of repeating it three times.
Committed r48102: <http://trac.webkit.org/changeset/48102>