Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing xcode project & install script. And adding support for full color spectrum. #1

Open
wants to merge 114 commits into
base: master
Choose a base branch
from

Conversation

robbiehanson
Copy link

Great work! Really cool project!

After forking it, I fixed the Xcode project so it would compile with Xcode 4. Then I fixed the install script (Xcode 4 puts the build directory in a different place).

After that I started using it and thought it was great. But then I started wondering... why limit the project to only 16 colors?

Digging around in the source code I discovered that you're passing colors into NSTextStorage. So I realized that, conceptually, the project could support virtually any color. Just so long as it could parse the color information coming in.

Now I realize that the original project was meant to be compatible with the ANSI escape codes. The basic 16 colors. However the Terminal.app in Lion uses xterm-256color. I debated updating the project to support the 256 colors, but I still felt like this limited the potential of the project.

Ultimately I felt like the best solution would be to allow the user to specify any color they want using RGB values. If they run the application within Xcode, then XcodeColors will honor the color exactly as requested. However, if the user runs the application from within the terminal, then the application should automatically map the requested color to the closest available color the shell supports.

But obviously XcodeColors can't help outside of Xcode. Thus the above solution requires code outside of the actual XcodeColors plugin.

What I've done is update XcodeColors to support the entire color spectrum. It uses the same escape sequence as before, but then parses RGB values afterwards (including a foreground vs background color indicator). It works like a charm!

In addition, I've added native support for XcodeColors to the CocoaLumberjack framework:
https://github.com/robbiehanson/CocoaLumberjack

I wrote a blog post about it too:
http://deusty.blogspot.com/2012/05/does-your-xcode-do-this.html

Additionally, the code within Lumberjack automatically provides the color mapping as outlined above. That is, if you run your application from within a terminal, and your terminal supports color (xterm-color or xterm-256color) like the Terminal.app in Lion, then Lumberjack automatically maps your color customizations to the closest available color supported by the shell.

robbiehanson and others added 30 commits May 21, 2012 23:30
…rking. But XCODE_COLORS_ESCAPE_MAC seems to work everywhere. This actually simplifies things!)
…et. Also adding common instructions via NSLog. This should make it easier to build and install.
DanSkeel and others added 30 commits September 10, 2015 22:52
Corrects minor typo: it's -->  its
Added support for Xcode 7.1 beta (7B60)
* commit 'c5b2b3599f7f2f7d1561d5c9f3543a080a8abb51':
  Corrects minor typo: it's -->  its
Updated the getenv(XCODE_COLORS) to getenv("XcodeColors")
Also some minor spacing updates
Added support for Xcode 7.1 Build version 7B91b
Update println to print for Swift 2.0
Fix "use of undeclared identifier" error
* commit '0ac37f4e3f1e796ad5375a7833444a658169c979':
  Updating bundle identifier.
  Adding mention of Xcode 7 to readme.
  Performing recommended project changes for Xcode 7.
  Update println to print for Swift 2.0
  Fix "use of undeclared identifier" error
  Added support for Xcode 7.1 Build version 7B91b
Converte binary plist file back to XML format
XCode Version 7.2 (7C68) release
CleanroomLogger is to Swift as CocoaLumberjack is to Objective-C, so naturally we added XcodeColors support!

This update to the README shows how XcodeColors can be used from the pure-Swift console logging API.
Add reference to CleanroomLogger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.