adobe/brackets — pull request #9596 by le717 (2014-10-19 00:34:00+00:00)
Title: [REVIEW ONLY] Add toggle case action to inline color editor

For #9519 (I just realized that only asked for Hex values but I did everything...)

I know this will be post-1.0, but I wanted to go ahead and get this in for review and because there are a few issues I haven't worked out yet that someone else might catch how to fix.

### Features ###
* New "U" button for toggling between uppercase and lowercase versions for RGB, HSL, and Hex values
* Preserves case between value conversions
* Related code updated to be case-insensitive
* New tests for conversion, with all existing tests passing
* Also did some minor code style fixes

This code is rather confusing (as already documented), so it was a bit of a challenge to get this written up. I once spent 30 digging around in various places for a one-line fix.

Now for the issues present here:
* I cannot get the button to receive the `selected` class when the conversion is toggled. I've tried every trick I can think of to no avail.
* This requires an update to TinyColor and a pending patch (bgrins/TinyColor#64), not yet included with this PR. The creator refactored the library a bit since the ancient v0.9.10 version currently used, and I've used those new APIs. TinyColor also unconditionally converts input to lowercase, which would make us have to keep track if the input is uppercase or not (which, in line with the previously documented issues, would be very hard because of the changing types). The aforementioned patch helps simplify the code by outputting it the same way it went in _only when `toString()` is called_. I had to have some manual tracking anyway, but it is much less than what it would be without the patch.
* On the topic of TinyColor, some new lines in the library (namely, [these](https://github.com/bgrins/TinyColor/blob/4d2e9f73365eb6a637ee770626c3ac519205a0a3/tinycolor.js#L1098-L1101)) break loading of TinyColor into Brackets. I am not sure if this is to be fixed in TinyColor or Brackets. Switching back to the previous version loads correctly, so I am thinking it is some TinyColor error.