0

Support references to other defined colors in color scheme files

Joel Thornton 12 years ago updated by FichteFoll 12 years ago 1
It would be useful in authoring and maintaining color scheme files to be able to reference the color choices of another entity in the same color scheme. This would simplify changing a given color or conceptual "color group".

Something like this:


<dict>
    <key>name</key>
    <string>Class name</string>
    <key>scope</key>
    <string>entity.name.class</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#A6E22E</string>
    </dict>
</dict>
<dict>
    <key>name</key>
    <string>Inherited class</string>
    <key>scope</key>
    <string>entity.other.inherited-class</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>entity.name.class</string>
    </dict>
</dict>


In this example, entity.other.inherited-class would use the referenced foreground color defined by entity.name.class.

Since ST2 color scheme files can contain named scopes which don't actually exist in any document, it would be possible to create scopes which are just used internally in the color scheme file to define a shared color, e.g. "colors.brightBlue".
I like the idea but I think it would be difficult to maintain the "tmTheme" thing (compatibility with TextMate) and requires a new standard (and file extension).