Solarized color scheme: we has it.

1,934 views
Skip to first unread message

Benjamin Staffin

unread,
May 2, 2012, 8:46:04 PM5/2/12
to chromium-hterm
If anybody wants to use the Solarized color scheme with chrome-hterm,
I've written a simple script to set it up for you:

https://github.com/benley/solarized-termcolor-osc4/blob/master/solarized.sh

You'll want to run that in your login script, and you will need to
manually set the terminal's default foreground and background colors
via the javascript console, as well as disabling bold-weighted fonts
like so:

// Disable bold.
term_.prefs_.set('enable-bold', false)

// Use this for Solarized Dark
term_.prefs_.set('background-color', "#002B36")
term_.prefs_.set('foreground-color', #839496")

// Use this for Solarized Light
term_.prefs_.set('background-color', "#fdf6e3")
term_.prefs_.set('foreground-color', "#657b83")

// And of course you can adjust the font-family, font-size, font-
smoothing values to your liking. I use this:
term_.prefs_.set('font-family', 'Menlo')
term_.prefs_.set('font-size', 12)
term_.prefs_.set('font-smoothing', 'subpixel-antialiased')

This works with solarized dircolors and various other things, but for
whatever reason not with console vim yet. Still working on that; it
probably has to do with vim being aware of 256 color mode, or perhaps
reseting the color values to their defaults when it starts. I'll post
an update when I figure that out.

Enjoy!

Benjamin Staffin

unread,
Jun 14, 2012, 5:18:18 PM6/14/12
to chromiu...@chromium.org
Shortly after my original message, someone pointed out to me a fix for vim; I forgot to share it here.  I've added a comment to solarized.sh on github about it, and uncommented the line that modifies the 256color palette's nearest-to-solarized colors.  I'm not sure whether or not vim switches those colors back to the original ones when it runs; the display on my chromebook has such poor color fidelity that I can't tell.

Anyway, you just need to add this to .vimrc, right above where you have "colorscheme solarized":

let g:solarized_termtrans=1
let g:solarized_termcolors=256

... and it ought to work reasonably well.

- Ben

datt...@gmail.com

unread,
Oct 18, 2012, 3:21:05 PM10/18/12
to chromiu...@chromium.org
I tried out your solarized.sh by sourcing it in my .bashrc. However, the colour that I have in my Chrome Secure Shell terminal (running GNU screen) is the same. Am I missing something?

dragon788

unread,
Apr 15, 2016, 8:38:55 AM4/15/16
to chromium-hterm, datt...@gmail.com
Make sure you used the instructions to open the Javascript console and pasted those set statements into it and pressed Enter to run them.

>> You will need to 

manually set the terminal's default foreground and background colors 
via the javascript console, as well as disabling bold-weighted fonts 
like so: 

Reply all
Reply to author
Forward
0 new messages