Jump to content

I'm creating a Solarized light/dark theme for SciTE - snips of reference code are welcome


mrider
 Share

Recommended Posts

Greetings all,

I went looking around for dark themes for SciTE and didn't have much luck.  No wish to necro-post, but I found this post -> A dark theme for SciTE but it seems as if things were ended at a single change for AutoIt where I was hoping for a comprehensive dark theme.  I currently have a dark desktop in Mint where xed, the terminal emulator, vim, and etcetera do an acceptable job of showing the dark theme.  Then I load SciTE and get blinded.  To resolve this, I'm currently working on creating a set of lang.properties files that use the Solarized themes (both light and dark).  The mechanism is simple enough: I wrote a small Perl program which parsed all the properties files and extracted all the distinct color values.  Then I assigned indexes to all the distinct colors, and wrote the colors themselves out to a separate properties file.  Next I parsed that and I used the formula for reducing the color palette to fewer colors as a baseline for generating the Solarized light theme - which turned out surprisingly less awful than I would have guessed.  Next I generated a color theme where all the colors are reversed for the Solarized dark theme.  The result is dark, but the individual source files I look at still need more help (Perl was particularly bad).  At this point, it is possible on my computer to switch to either the Solarized light or dark theme with one line of text in my user options file.

Now I'm working my way through source-code cleaning up the result.  My first stop is completing Perl, but AutoIt is my next stop.  I'm happy to put the modified files out there for all to use (if you want them).

I'm willing to do all the legwork for all the properties files.  The problem is that I'm only familiar with some of the languages that SciTE recognizes (for example - I wouldn't know Baan if it bit me on the butt).  I looked all around both the Solarized website and the Scintilla/SciTE website, and I can't find any reference files that can be used to test the colors.  Which means that any language I don't understand will get the colors chosen by the algorithm, which is admittedly fairly rough. 

 

Which leads me to this post: What would be particularly useful would be code samples in different languages.  The more of the style numbers that are touched in that language the better.  I don't care if the code is "quality" code, I'm more interested in whether the code snip is properly colorized (for some values of "proper").  I understand that nobody is obligated to help me with "my project".  However, I promise that I will do my best with any code snips in any language and I will post the results here.  I'm using xed and vim as my templates, so my results will (mostly) resemble results there.

I'll post my work here as time progresses, I'll probably have a working version for Perl and AutoIt in the next few days, and I'll do my best with other languages going forward.  As I say, I welcome code snips in any language that SciTE colorizes using a properties file.

 

Edit1: Attached is the first Solarized Version.  I have only tested this in the default install of SciTE.  I'm certain there are going to be differences between the default install and the full version, but I don't yet know what those differences will be.  To use this:

  1. Detach the zip file.
  2. Drop the folder into your profile directory.  For example: C:\Users\mrider\Solarized .
  3. Open your local options file in SciTE (Options -> Open User Options File).
  4. Add the line "import Solarized\SolarDark" (without the quotes) to your file.
  5. You can turn the dark theme on and off with a comment character (#) at the beginning of the statement.
  6. Enable "Solar Light" theme similarly using "import Solarized\SolarLight".

As I say, this doesn't work in the full version, so only use this if you are using the basic version.  I'll chase the full version next.

 

Edit2: Attached is the second Solarized Version.  This works with the full install of SciTe, but so far I've only tested it with Autoit, Batch Files, and Perl.  I'll keep expanding the languages as I go.  To use this:

  1. Detach the zip file.
  2. I had to navigate to "C:\Program Files (x86)\AutoIt3\SciTE" and relax the file permissions to perform the next step.
  3. Drop the folder in the SciTE install directory (it doesn't seem to work in one's profile directory).
  4. Open your local options file in SciTE (Options -> Open User Options File) - note that this opens the user properties file inside the SciTE directory, not your profile.
  5. Add the line "import Solarized\SolarDark" (without the quotes) to your file.
  6. You can turn the dark theme on and off with a comment character (#) at the beginning of the statement.
  7. Enable "Solar Light" theme similarly using "import Solarized\SolarLight".

 

Solarized_AutoIt_SciTE_version_only.zip

Solarized_SciTE_Full_Install.zip

Edited by mrider

How's my riding? Dial 1-800-Wait-There

Trying to use a computer with McAfee installed is like trying to read a book at a rock concert.

Link to comment
Share on other sites

As I say, I'll keep working on this.  Perhaps some of what I detail below will become more clear as I learn more - but I've made some interesting discoveries that are possibly my fault...

  • The full version of SciTE doesn't seem to like having "SciTEUser.properties" in the user's home directory.  This works in the "AutoIt" only version, but not the full version.
  • Additionally, SciTE in Linux honors the user's theme settings.  Which is to say ~/.SciTEUser.properties works just fine out of the box.  So the problem that I'm encountering is Windows only.  I wouldn't be surprised to learn that this is something I'm doing wrong, although I'll be hanged if I can figure out what it is.
  • I have not found a way to change the window colors (header, toolbar, borders, etcetera).  This is probably a Windows setting rather than a SciTE setting, since it works perfectly fine in Linux with a dark desktop theme, and Windows is notably stubborn about colorized themes.
  • I have not yet found a way to change the colors of the code suggestion that pops up when one types half of a command.  The themes above still show the default window's colors (off-white and blue).  This might simply be a matter of me not discovering the proper style setting.
  • I can change the color of the calltips, but the part that highlights your next parameter remains the default color.  Interestingly enough, the default color is dark blue in the AutoIt-only version of SciTE, but a bright red in the full version.  Again, this might simply be a matter of me not discovering the proper style setting.
  • Perl was ghastly when I used the colors that the parser generated, I pretty much modified every setting by hand.  I expect this to be the case with many of the languages, which is why code samples could be helpful.
  • The full version themes have a section of "DO.XXX" values with a default of "0".  This keeps the corresponding language from turning dark, which is helpful when one is trying to tell the difference between the default style and language specific sections.

 

How's my riding? Dial 1-800-Wait-There

Trying to use a computer with McAfee installed is like trying to read a book at a rock concert.

Link to comment
Share on other sites

I use https://www.deviantart.com/niivu/art/BIB3-for-Windows-886441919 and it'll do what you'd like to see, just like in Linux :)
image.png.a671da4d0d1aa8dc743b6e751213454b.png

..and the pic above is with the dark theme from "SciTE config for AutoIt3"

Edited by argumentum
add the pic.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...