Sublime Forum

SublimeJSONColorSchemeEditor - GUI edit syntax colors

#1

This tool will let you use a GUI to visually see, edit, and add name/scope definitions to your color scheme files. It is written in AutoIt3 - but there is a compiled EXE if you don’t have AutoIt3.

The only caveat is that this tool only reads JSON format files. It was too tedious for me to figure out how to read the Plist format with AutoIt3 - whereas there was a ready made function library for JSON which this tool uses to read and write. So you must first convert your color scheme into JSON via PlistJsonConverter Plugin or AAAPackageDev Plugin and then open that JSON file with this tool.

Download: SublimeJSONColorSchemeEditor.zip - includes compiled EXE and also source .au3 files if you would like to run/edit with AutoIt3.

Update: Please re-download to update to v1.08 - bug fixes, major speed improvements, and window can now be resized.

0 Likes

Better Python syntax highlighting?
Modify / Customize Color Schemes
#2

I have considered doing something like this for a while, but never had the time. It would be nice to pair this with commands that auto open it for you etc. I will have to try it out. Thanks.

0 Likes

#3

@facelessuser - let me know of anything I can do to help with integration with your PlistJsonConverter Plugin. You are welcome to bundle this with your plugin. I wrote this tool because I felt there was a barrier to people being motivated to develop good syntax highlighting color schemes due to the complexity of working with XML files and then visualizing the result. Hopefully with the right tools - the Sublime ecosystem can have richer syntax coloring color schemes.

Also, I have updated the program to now auto-load a file passed to it from a command line argument, accept drag and dropped filenames into the filename field, as well as fixed a bug with the global theme color boxes updating.

Also, for some reason the ListView becomes a bit slow sometimes when adding or updating many rows. (UPDATE: fixed in v1.05)

0 Likes

#4

I kind of like this. My only real problem is that it is Windows only. What my plan has always been, was to code a GUI up in Python and use PyInstaller to generate binaries for Windows, Mac, and (I think it can do linux). The plus side of this is that I can support it all in one code base, and since it is Python, I can embed the JsonToPlist logic directly in it (it could generate the plist and the json from either file). I imagine the final implementation would simply be to call the executable with the file name of either json or plist and then when you save in the editor, it would dump the json and plist. Since it is always writing the plist out, you could watch the colors update in the editor.

0 Likes

#5

Slowly working on a cross platform python version:


0 Likes

#6

uhh no, use html5 instead… :unamused:

0 Likes

#7

really cool everyone^^^

0 Likes

#8

If all major browsers supported everything I needed in HTML5 besides just Chrome, then I would consider it. Maybe things have changed recently…I don’t know. People who do HTML coding all of the time also like to suggest things like this, there is nothing wrong with it, but when you are a hammer, everything looks like a nail. Maybe I’m the hammer here maybe not, but I don’t really care right now.

I see it in my profession all of the time, even when it would make more sense to use something else…people like to use what they know. I know people that swear by Pearl even though I think its awful (I still use it when I have to). Also, I don’t think it matters, if the result is the same, what does it matter what language I use?

HTML5 is a perfectly valid solution, and something I may consider when the major browsers support what I need. I do have code I can work off for that if I do that as well.

0 Likes

#9

Looking nice already. Making GUIs in python is something I haven’t done but am interested in learning. Which GUI library are you using? The default tkinter or something like wxpython? Also, what do you think about something like this? ObjectListView:
blog.pythonlibrary.org/2009/ … -listctrl/

After playing with editing themes in a GUI, here are a couple things that I think would be nice:

  1. Allow sorting via the scope column.
  2. Allow loading of a .tmLanguage file which would show which color scheme scope each language definition matches up to - this would also allow a user to easily see if certain langauge rules that they have currently defined might be going unused with their current color scheme. This would help .tmLanguage creators to define scope rules that best work with a variety of 3rd-party color schemes.
0 Likes

#10

Bump. Original Post download link updated to v1.05 - major speed improvements when updating row items.

0 Likes

#11

[quote=“robertcollier4”]Looking nice already. Making GUIs in python is something I haven’t done but am interested in learning. Which GUI library are you using? The default tkinter or something like wxpython? Also, what do you think about something like this? ObjectListView:
blog.pythonlibrary.org/2009/ … -listctrl/

After playing with editing themes in a GUI, here are a couple things that I think would be nice:

  1. Allow sorting via the scope column.
  2. Allow loading of a .tmLanguage file which would show which color scheme scope each language definition matches up to - this would also allow a user to easily see if certain langauge rules that they have currently defined might be going unused with their current color scheme. This would help .tmLanguage creators to define scope rules that best work with a variety of 3rd-party color schemes.[/quote]

I am using wxpython. Specifically I am using wxFormBuilder to create the GUI. The latest beta of wxFormBuilder is pretty good on Mac (there are still a few bugs on mac though), but a little buggy on windows, but I usually work around the bugs on windows. The interface for building GUIs is the best I have seen for wxPython, the downfall is that it is a bit buggy. It basically allows you to visually build GUI classes, and you just generate the code and derive your class from the generated code (you don’t directly modify the generate code).

  1. Sorting is a bit funny, because you may or may not have realized that the order of the color entries is important as well. Global settings are not order dependent, but the scope entires are. Right now in my python version, it dynamically displays the global stuff, and the scope stuff. It also allows you to modify the order. I will be adding the ability to insert new records or delete records next. Lastly I will add actual modification support, right now it just allows you to reorder stuff and view it. There are possibly interface aspects that will change as I get closer to finishing; right now it is just a rough prototype.

  2. I may look into this further down the road, but right now, I just am looking to allow basic editing and visualizing right now.

Very rough prototype screenshot (visually stuff will probably change as I get closer to completion). Basically, you can view all of the attributes, and if you press “alt+up” or “alt+down” while on a row, that row will move up or down respectively. Global list is on top, scope list is on bottom. The only thing missing is global settings that don’t use a color setting:


0 Likes

#12

Can now handle all global settings. Also sizes better now. That is it until after work today.


0 Likes

#13

Okay one more :smile: (better layout)…now I need to get ready for work:


0 Likes

#14

I am getting close to being able to release a beta of this on at least Windows and Mac. It is able to edit pretty much everything. I still need to add the ability to create new rules and delete old ones. But one thing it does pretty nice is simulate how Sublime does transparency so you will know exactly what the colors will look like in Sublime. It will tap into the systems color picker dialog as well, but since most don’t access alpha, right now you can just manually tack on the alpha when you pick the color. If I am not too busy, I may have the beta out this weekend.

0 Likes

#15

@facelessuser Looks slick and simple. Any chance you’ll post the source code on Github for the rest of us to learn from (make sure you include a license)?

0 Likes

#16

Yeah, I will post the source for sure as soon as I clean it up. Probably not right away, but eventually. I should be releasing a workable beta sometime today for windows and mac (I haven’t compiled and tested the linux one(s) yet) but I should have a 32bit windows (that can be run on 64bit or 32bit windows), and a Mac one.

Linux will come when I have time to boot up a virtual machine and try it out.

0 Likes