Home Download Buy Blog Forum Support

Color Scheme Builder

Re: Color Scheme Builder

Postby quodlibet on Sat Jun 23, 2012 3:06 pm

Yes, you're right. But I was talking about nesting two different scopes. (I've been tinkering with punctuation recently, so that's what I was thinking about specifically.) For example, if you take the following CSS:

Code: Select all
.someclass


"someclass" has a scope of: "source.css meta.selector.css entity.other.attribute-name.class.css"

While the dot has a scope of: "source.css meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css"

The way to style the punctuation in this case is to use a scope like "entity.other punctuation".

In practice, this gets quite cumbersome. Here's an example from one of my (probably misguided) styles:

Code: Select all
{
    "name": "Green",
    "scope": "entity.name.class, entity.other.inherited-class, entity.name.function, entity.other.attribute-name, markup.inserted, at.tag.workflow, hash.tag.workflow, meta.task.completed.workflow punctuation",
    "settings": {
       "background": "#99cc0005",
        "foreground": "#669900"
    }
},
{
    "name": "Green Punctuation",
    "scope": "entity.name.class punctuation, entity.other.inherited-class punctuation, entity.name.function punctuation, entity.other.attribute-name punctuation, markup.inserted punctuation",
    "settings": {
        "foreground": "#99cc00"
    }
},


I could be wrong, but this seemed to me to be the least painful way to write this out.

I would have preferred something like:

Code: Select all
entity.name.class, entity.other.inherited-class, entity.name.function, entity.other.attribute-name, markup.inserted {
   background:lighten(@green, 100);
   foreground:@green;
   punctuation {
      foreground:lighten(@green,20);
   }
}


Does this make sense? :?
quodlibet
 
Posts: 561
Joined: Sat Jun 18, 2011 5:53 pm

Re: Color Scheme Builder

Postby agibsonsw on Sat Jun 23, 2012 3:46 pm

While conceding that I haven't explored this in detail, it still seems to me that your theme-colouring could be simplified as indicated in my previous post. But I may be wrong :)

It is a shame, though, that we can't use variables in a theme-file (I think TextMate can, if I recall correctly?).
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Color Scheme Builder

Postby quodlibet on Sat Jun 23, 2012 4:04 pm

I'm not entirely sure, either. That's one of the reasons I wanted to raise the issue. If I'm simply going about this the wrong way, my hope is that someone would correct me. Also, editing the punctuation in this dogged manner is an experiment more than anything else. My original interest in this particular aspect came out of a legitimate question for styling Markdown. (See: viewtopic.php?f=2&t=6890 ). What I think I am doing *is* using the cascade.

I just spent a couple minutes looking at the Espresso Soda theme, which tinkers with the punctuation of strings and they do it by editing (separately) the scopes for "string" and "string punctuation". So I suspect there's no better fix.

Edit: yes, variables would be great.
quodlibet
 
Posts: 561
Joined: Sat Jun 18, 2011 5:53 pm

Re: Color Scheme Builder

Postby agibsonsw on Sat Jun 23, 2012 4:29 pm

The only other suggestion I have it to explore the idea of stating the scope from the end, rather than the beginning :?:. So, for example, just scope "punctuation" and then also "something.punctuation". I would try skipping parts of the scope: "firstbit.lastbit", but I don't how this would work without experimenting - I suspect it would need careful (strategic!) planning.

If I ever do this again I might consider:
Opening a large file for my chosen language;
Create a command to extract ALL of the scopes into a view;
Sort this list and remove duplicates.

Actually, I would perhaps go a stage further and create a dictionary from this list of scopes :D. But I know that this doesn't help you at this point.. Soz.

Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Color Scheme Builder

Postby FichteFoll on Fri Jun 29, 2012 5:40 pm

quodlibet wrote:
Code: Select all
entity.name.class, entity.other.inherited-class, entity.name.function, entity.other.attribute-name, markup.inserted {
   background:lighten(@green, 100);
   foreground:@green;
   punctuation {
      foreground:lighten(@green,20);
   }
}


Does this make sense? :?


I like that. It's (S)CSS, it's human readable and more importantly it's parsable. You can do it just like SaneSnippets. Make a tmLanguage definition for this type of a theme, write the parser in Python and now you have your tmTheme. It could even be automatically parsed when saving a file with a specifix extension (see SaneSnippets). Yeah, I already have concepts for that, but no time I'm afraid.
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Color Scheme Builder

Postby nickp on Tue Oct 02, 2012 8:02 pm

Is this project still going on? Did anything ever come of it? I might be able to help out if progress has stalled. I'd really love to see this reach the finish line. :)
nickp
 
Posts: 1
Joined: Tue Oct 02, 2012 7:59 pm

Re: Color Scheme Builder

Postby caspur on Sat Oct 06, 2012 2:05 am

Maybe I'm being a bit naive, but...

I've been using "TextMate's Built-in Theme Editor" to create my own custom color schemes. This saves as a ".tmtheme" file which is interpreted / compatible with Sublime Text 2 when placed in the "packages" folder.

Right???
caspur
 
Posts: 1
Joined: Sat Oct 06, 2012 2:03 am

Re: Color Scheme Builder

Postby SeanWcom on Fri Oct 12, 2012 1:16 pm

Yes, Textmate themes work (for the most part) just fine in ST2... but that doesn't help those of us using Windows. ;)
Multiple selections... one of my favorite ST2 features. View some noob-friendly screen casts here.
SeanWcom
 
Posts: 101
Joined: Wed Aug 03, 2011 1:31 am
Location: Georgia

Re: Color Scheme Builder

Postby FichteFoll on Tue Oct 23, 2012 2:46 pm

nickp wrote:Is this project still going on? Did anything ever come of it? I might be able to help out if progress has stalled. I'd really love to see this reach the finish line. :)


If you're talking about a scheme builder in general I doubt that someone has started with that. I am still planning to write the CSS-like language including a parser as I mentioned above but apparently I want to finish my ongoing projects first. You are free to start with that on your own and when I have some time again I might help you out with that.

However, you can try using AAAPackageDev (more specifically this fork which I'm currently developing as a pull request) to write the definition in YAML and then convert it into plist. I recommend you to read the comments in that pull request for instructions on how to use, though.
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Color Scheme Builder

Postby aziz on Wed Oct 31, 2012 5:21 pm

You might want to try my color scheme editor here:

viewtopic.php?f=5&t=9856

Image
PlainTasks: my opinionated todo plugin
tmThemeEditor color-scheme editor for SumblimeText and Textmate (code on github)
aziz
 
Posts: 40
Joined: Thu Jan 12, 2012 6:29 pm

PreviousNext

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests