NetBeans Color Scheme: Solarized Dark with PHP Tweaks

Posted by jeremyclarke on August 17, 2012 · design · WordPress

Jump to download and installation instructions »

What is Solarized?

solarized logoSolarized is a programming color “palette” designed  by Ethan Schnoonover for use when writing syntax-highlited code. It’s based on color wheel and lightness relationships and it’s all sciencey and stuff, but the essence is that all the colors look good together and have good contrast, so you can use the different colors for different parts of your code (functions, variables, strings etc.) and no matter how you organize it the result should be easy on the eyes. It also has both a “dark” and “light” mode with different background/foreground colors, but most of the colors (red, green, magenta) work the same for both, which is cool.

Here’s a color reference I put together showing the various colors in Solarized Dark along with their RGB and hex codes. It was very useful to have around while working on the NetBeans theme (the Solarized site is strangely lacking a similar reference).

My Solarized Dark theme for NetBeans+PHP

As soon as I heard about Solarized I wanted to try it out with NetBeans, my IDE of choice for PHP/WordPress coding. I’ve spent many an hour tweaking my color schemes in NetBeans (and Smultron, my old text editor before that) and choosing the color relationships was always the hardest part, so having classy choices all laid out for me was very appealing.

The good news was that there is already a NetBeans port of the Solarized colors that worked as advertised. The problem was that IMHO it wasn’t particularly well executed. NetBeans has a lot of options in the color scheme settings, but they are also extremely confusing and often flat-out misleading, so I don’t blame the original author for not getting it perfect. He also may not have been looking at PHP code, in which case it makes sense that the PHP-specific color settings weren’t well organized. Lastly there’s a huge element of personal taste, even within the process of implementing a preset color theme like Solarized, so I recognize that the result is really just my personal opinion of what NetBeans+PHP+Solarized should look like.

All that said, here’s a screenshot of my NetBeans Solarized Dark theme:
Screenshot of my solarized dark theme for Netbeans

I like to think it balances the need to have different parts of the code be different colors and the limitations of doing so using the NetBeans color settings. It should work just as well with procedural and object-oriented code.

One feature I added that isn’t in the original Solarized for Netbeans colors is SVN support. I had to invent them, but my theme has appropriate red, green and blue background colors when viewing a SVN DIFF.

Installing my theme in your NetBeans

Since NetBeans has a configuration import/export system you can install these colors really easily.

  1. Download the .zip file linked below (don’t unzip it, NetBeans wants it as .zip).
  2. Open NetBeans and summon the Preferences window (Options on Windows).
  3. Go to the Fonts & Colors Preference tab.
  4. Click Import at the bottom of the window.
  5. Click Browse and find the .zip file, click OK.

Download netbeans-colors-solarized-dark-jer.zip »

Once you have the theme installed it should show up in the Fonts & Colors preferences as part of the Profile pulldown menu, where it’s identified as Netbeans_Solarized_Dark-jer.

Since I started using this I pretty much never feel the need to use a “light” theme so I haven’t tweaked the Solarized Light colors at all. Sorry if that’s what you would have preferred ;)

Anyway, hope some of you find this useful! I plan to someday get some of my changes added to the official GitHub repo, but wanted to get this out before my Code Faster and Smarter PHP with IDEs Like NetBeans talk tomorrow at WordCamp Montreal.

Posted by jeremyclarke on · design · WordPress

14 Comments

  1. Stephane Daury (@stephdau)

    Just installed it, will try it out and see, since I resumed trying to use NetBeans (instead of just vim) on Monday.

    August 22nd, 2012 at 11:25 am

  2. Stephane Daury (@stephdau)

    Follow up: all I did was switch to a black background (vim/terminal habit) and reduced Monaco from 12 to 11pt, and am happy as a clam. Thanks J! :)

    August 22nd, 2012 at 4:11 pm

  3. Andy

    Really well balanced, love it. Before that, I tried Desert and Oblivion, but your theme is the best of the lot. Thanks, bro!

    August 27th, 2012 at 9:45 pm

  4. Andy

    Forgot to mention: works better for me in Consolas than Monaco.

    August 27th, 2012 at 9:46 pm

  5. jeremyclarke

    Andy: Thanks! I never asked it to include the font as part of the export file, just the color scheme, but it included it anyway (I went back and checked and there’s no option to export without the font). I like Monaco but obviously there’s no reason why these colors wouldn’t work with any font you were already using.

    August 28th, 2012 at 9:34 am

  6. Andy

    I too like Monaco. It’s just a fixed-width story—many comments that are meant to line up perfectly.
    Today I upgraded NB to 7.2 and saw there were some profiles in there… but none of them usable. Again, great work Jeremy, I linked to your site and will come back to see if you have come up with any improvements. Thanks heaps, wishing you a fun week.

    September 2nd, 2012 at 6:49 am

  7. Sebastian

    I prefer oblivion_revival from http://codesleepshred.com/dark-netbeans-themes-oblivion-revival-and-monokai/

    October 3rd, 2012 at 1:37 pm

  8. Groovix

    Love the color scheme, thanks for sharing.

    November 2nd, 2012 at 10:08 am

  9. Nicolas Muller

    Uau. Thats a great scheme. I started to use now. My eyes appreciate.

    December 8th, 2012 at 8:30 am

  10. Colin

    I really like this theme – thanks!

    December 14th, 2012 at 7:36 am

  11. Tom Auger

    Hey Jer, great stuff. Finally got around to installing it. Only changes I made was to use the awesome (open source) Adobe font called “Source Code” (which you can download from SourceForge here: http://sourceforge.net/projects/sourcecodepro.adobe/?source=dlp).

    I found that (with my monitor) I needed to bump th font size up to 15 and then needed to increse the line-spacing a bit (which you can’t do through the GUI). Here’s how to adjust line-spacing in netBeans 7.2.x: http://superuser.com/questions/207393/how-to-configure-the-editors-line-height-in-netbeans-6-9-1/537807#537807

    Cheers man.

    January 17th, 2013 at 1:09 pm

  12. Tomas Pavlatka

    Thank you man for this scheme. I’ve tried a lot of before, but this one is exactly what I was looking for.

    January 18th, 2013 at 3:54 am

  13. jeremyclarke

    Hey Tom Auger. Glad you found it useful. I actually switched over to using the Adobe Source Code Pro font as well. It’s one of the first ones I’ve found that works all over OSX without being rendered horribly (I’m not sure why it happens, but few other fonts look good in Terminal, and for some reason I feel the need to have the same fonts everywhere).

    January 19th, 2013 at 7:20 pm

  14. Vitor

    Works like a charm for me. Love the theme!
    Thanks man!

    August 25th, 2013 at 9:53 am

Add new comment (email only seen by Jeremy)