scopatz / nanorc

Improved Nano Syntax Highlighting Files
Other
3k stars 549 forks source link

Solarized? #42

Open ChristopherA opened 9 years ago

ChristopherA commented 9 years ago

Any chance for branch that uses the Solarized theme? It is probably the most popular color theme.

-- Christopher Allen

scopatz commented 9 years ago

I would accept it, if someone else implemented it :)

ThomasR commented 8 years ago

nano does not offer more than the 16 ANSI colors, so I guess it's not possible.

Valid colors for foreground and background are: white, black, red, blue, green, yellow, magenta, and cyan. You may use the prefix "bright" to get a stronger color highlight for the foreground. If your terminal supports transparency, not specifying a bgcolor tells nano to attempt to use a transparent background. http://www.nano-editor.org/dist/v2.5/nanorc.5.html#SYNTAX%20HIGHLIGHTING

smammy commented 3 years ago

Solarized is a 16-color theme, but it (ab)uses four of the "bright" colors to provide a wider range of greys.

Assuming the user has set up their terminal such that the 16 standard ANSI colors are mapped onto either the Solarized Light or Solarized Dark palette, I think it would be possible to transform existing color/icolor statements to use Solarized-compatible color names.

Because brightgreen, brightyellow, brightblue, and brightcyan are actually various shades of grey in Solarized, those colors would have to be mapped elsewhere. The lazy way would be to map them to their non-bright equivalents. brightred and brightmagenta are used for orange and violet, but those are probably close enough to leave alone.

I'll play around with this and see if I can come up with anything usable.