Sublime Forum

(osx|windows|linux) Color Scheme Editor (BETA)

#25

0.0.3 for OSX and Windows is now available.

Please read opening page for more details and for links as things have changed. Delete color_scheme_editor.py from you user folder. Install plugin from github, and then select your platform and download the binary to your user folder (if you wish to put it elsewhere, that can be configured in the plugin).

Changes:
Plugin
-Can now create a new theme via the command palette
-Can access the filepicker for the editor via the command palette
-Interlock check for version between plugin and binary

Binary
-Fix a bug were the tables weren’t getting updated when the global background and foreground settings got changed
-If launched standalone, asks if you want to open an existing theme or create a new one
-If given a .tmtheme file or json file, the editor will now take appropriate action on its own.

Note:
OSX seems to hate the wildcards for the filepicker. The wildcards work fine in windows, but weird in OSX…I will have to resolve that at a later date.

0 Likes

#26

I should have OSX wildcard stuff in filepicker dialogs sorted out in next update. Turns out “.JSON" works, but ".tmTheme.JSON” does not. It seems to only respect the very end. This is fine though, in OSX I will simply let the user pick a JSON, and if it is not a “*.tmTheme.JSON” I will make them pick again until they get it right :smile:.

0 Likes

#27

I’d love to have a way to load undefined scopes into the theme editor when editing a theme for a particular language. Sometimes I hop into a different language and see elements that would nice to have some different highlighting. This would be a great way to get into that. Feel free to mark this down as a feature request for down the line if it’s a pain in the ass.

Or… if there’s a way to place your cursor somewhere, get the scope and either jump to that scope in your current color scheme or add it if it doesn’t exist might be better.

0 Likes

#28

ScopeHunter is a plugin I wrote that you can configure to put the scope of what is under the cursor into your clipboard (it also can show you a lot of other stuff, but you configure it how you want it to work). So you can use that to quickly get the scope into your clipboard, then you can open up the scheme editor.

The tool and the plugin don’t really communicate right now, so simply sending the editor process something to search for isn’t possible at this time. I do plan on adding a search option, and who knows, maybe I will implement some kind of communication between the plugin and the editor down the road. I might also implement importing undefined scopes into a theme at a later date as well. I just have to wait till I have time to explore more options. Right now I just want to get the basic stuff down, and get it to a stable release.

0 Likes

#29

Probably sometime tomorrow, I will probably post 0.0.4. This will add “save as” functionality, fix OSX wildcard file dialog issue, add file name in title bar, search etc.


0 Likes

#30

@facelessuser

You considered embedding pure python tornado 3.0 as a websocket server for (browser <–> sublime) communications ?

Angular JS / CoffeeScript / LiveReload etc make html5 pretty damn sweet these days :smile:

re: scope hunting

Back in the day I was trying to hunt down a bug in the CSS grammar, and much to my confusion, multiple rules were applying the same scope name.

This led me to create a grammar generator that would create a unique id, patching the scope names with bla.do.dont.#0F3A4 etc

That way you can easily *regexes-applied

I say this, as creating color schemes is much the same task as a creating grammar at times.

0 Likes

#31

[quote=“castles_made_of_sand”]You considered embedding pure python tornado 3.0 as a websocket server for (browser <–> sublime) communications ?

Angular JS / CoffeeScript / LiveReload etc make html5 pretty damn sweet these days [/quote]

I don’t do a lot of web type programming. Any web programming I do is hobby stuff, so I am not often not up on the latest web based programming packages etc. With that said, the idea of having sublime plugins communicate outside itself with sockets and/or pipes as been something I have been thinking about. I think html5 is a logical jump for people doing a lot of html coding, but it doesn’t always occur to me since I do very little to no web based programming during my day to day. I will probably take a look into it though, Tornado looks pretty cool.

Yeah, I discovered the same thing when doing the ExportHtml plugin. Background, foreground, fontStyle have to all be evaluated separately. If a rule doesn’t explicitly define all three, they inherit from the rule that is a closest match that does define the missing attribute, defaulting to either the default background, foreground colors (as applicable) if none are found. In some ways it makes sense, but in other ways it is confusing.

0 Likes

#32

Having used both kits I would say, even to my own surprise, I’d actually prefer to use Angular/Coffee over PyQt.

Definitely worth learning some nodejs, cause a lot of the front end guys make their tools using it. See grunt/karma etc

Front end is actually quite pleasant these days. Give it some weekends :smile:

0 Likes

#33

I have already written some stuff in node.js, but again, not really a web guy, but I like to play with it. Python is a very valuable skill in my field, where as node.js is only nice if you are a front end tool guy. Though I do my own tools, I am not a tool guy really.

0 Likes

#34

You do embedded stuff if I recall correctly?

What do you use python for? other than ST plugins of course :smile:

0 Likes

#35

You’d be surprised. Engineers use languages like Python or Ruby for lots of things. I one time was given the task of identifying what in our Hardware Abstraction Layer (HAL) needed to change for two different new pieces of new hardware we were going to start using. It would have taken me days. I wrote a tool to process all of the registers for the new hardware and compare it to the closest hardware in our HAL. Compile a list of all kinds of changes, and then based on rules, filter out the ones that were probably not a big deal, then scan our code base for references to those different registers further filtering out which ones I needed to look at. Now the task takes me 3 seconds. Now I just get sent a spreadsheet of registers for new hardware, fire up my program, and I get a printout of important register differences and what file and what line in our code we access it. Then I just need to fire up my editor and look at those individual cases, or hand off the output to whomever is doing the task instead of me. That’s just one case.

0 Likes

#36

Yeah, it’s pretty hardy to beat python as a general purpose scripting language. pip install $magic :smile:

0 Likes

#37

0.0.4 is available (go ahead and update the sublime plugin part as well, but it isn’t critical to do so).
-File name in titlebar
-Add menu
-Shortcut help
-Change shortcuts to make more sense
-About box
-Save as functionality
-Wildcard fix for OSX
-Add search
-Small fixes
-Better debug stuff inside
-Anything else I forgot

With that said, there are a couple of things I hope to fix in 0.0.5 (hopefully the last beta) coming up:
-Faster, more optimized update of internal theme structure on live edit changes (maybe only save tmTheme file on updates, and update JSON on close of file).
-Possibly allow disabling of live editing of the file for those who want to; manual save (would be even more snappy then).

That’s really all I have left before an official release, unless some bugs crop up.

0 Likes

#38

u r my hero, point

0 Likes

#39

0.0.5 is up. (Plugin side must be updated as well, or live edits won’t work until you do).

-Live edit now optional
-Manual save mode (more traditional app behavior) is now default (but when run from plugin, default is live edit)
-Save as shortcut moved
-Re-write shortcut code
-More optimized updating of the JSON
-When in live edit mode, only re-generate JSON on app close.
-Generate missing tmTheme or JSON on startup
-Protect against duplicate keys in global settings
-Fix regression: cell highlight didn’t change on color luminance

Okay that is all the current planned features for the first official release. Probably just need to throw together some kind of icon now…oh yeah, and get linux running.

Anyways, report any bugs if you find them. I don’t plan on adding new features or tweaking this until after the official release, so now is the time to find and report the bugs.

0 Likes

#40

I wanted to announce known bugs:

  • Removing all font styles will leave the table in the editor still showing the last font (cosmetic). Will be fixed in next release.

  • When moving an item, and it goes out of view, the scrolling does not follow the item (cosmetic). Will be fixed in next release.

  • When moving an item (particularly in a large theme file), sublime will throw invalid XML errors. This is not an error with theme generation, just that sublime can’t keep up with reloading the files proper with the live editing enabled. Possible fix coming in next release

All of the above issues will be fixed, but the XML error is bit trickier. I can probably add a delay after live updates to give sublime enough time to reload, maybe half a second? I will probably try it out in the next release to get feedback from users.

0 Likes

#41

Hey man, pretty damn nice plugin. It somehow remember me of e-text :smile:

Few issues/improvement ideas (i’m on windows, i have no idea what’s happening on other platforms):

  1. Maybe it’s a good idea to set the background of the scope settings tab to be the same as the theme background, otherwise…
  2. double click on a scope to edit. Press Esc. Nothing happen (it should either go away silently, something like a Cancel)
0 Likes

#42

1.) Are you sure it isn’t? For me, the editor sets the rows of all entries to their defined background color, and if not, it sets the background to the global background. If you aren’t defining a global background, then I think it will default to white, just like Sublime does. Is this not what you are seeing?

2.) Yeah, I like that, it was on my list…the list in my head which I should have written down so I wouldn’t have forgotten this :smiley:.

0 Likes

#43

Ahhh!! Now make sense!

One more idea: add buttons for add/remove scopes. I had to fiddle a little to find out that is ctrl+i. Probably two small buttons at the bottom of the window? :smile:

0 Likes

#44

Press Ctrl+B or CMD+B on MAC to see all keybindings. Also, you can go to Help->Shortcuts to see the same keybinding list.

Yeah, buttons might be more intuitive for people just starting to use it. I will look into it.

0 Likes