This is enabled by adding the following to your theme:
colorSpaceName = sRGB;
The default color space used for themes is “Apple Generic RGB” which is a bad choice for interoperability with other software (e.g. exporting a theme to CSS, creating theme colors in Photoshop, and similar).
Related to issue #768.
Since styles_for_scope effectively ignore the font parameters (and instead return styles based on the font parameters used when the cache entry was created) it is a better design to have theme_t own the font. This way, changing it can do the proper cache invalidation.
A minor downside is that we can now change the font of the theme without also changing the layout’s font, which wouldn’t cause proper layout invalidation — since layout_t owns theme_t though, users of a layout should always change font via layout_t (which will then change it in the theme).
Also, themes cannot be shared between views that wish to use different font settings.
Font name and font size was being used in the cache key as a way to avoid having to do cache invalidation. This comes at a price of a 3X slow down. Instead clear the cache when font size/name changes. Excessive font name/size switching should be deterred IMO, why not with slowdowns? so no real downside. This does not affect themes setting font name/size, as they are handled by another mechanism.
Previously, if no themes were active, the gutter colors would
not be set. This would, effectively, give you random gutter colors
on TextMate startup. (or, sometimes, a completely transparent gutter).
Previously all the colors were calculated so setting e.g. the icon color made it sort of necessary to also set the iconHover and iconPressed color.
Now the default icon hover and pressed colors are a potential user supplied icon color. Likewise, the default icon color is a potential user supplied foreground color, etc.
This removes all the blending, the need to provide a scope selector to obtain them, and no longer taxes the general syntax highlight (by no longer having to carry around a dozen gutter styles per scope).
Use the text foreground color for icons when the theme doesn’t provide a color and introduce ‘gutterSelectionIcons’ for the color of selected icons (defaults to selected foreground color).
Also changed the gutter selection border color to match the divider color (when it isn’t specified by the theme).
Previously if the color for X (where X is e.g. foreground or invisibles) had an alpha value other than 1.0 (fully opaque) it would be blended against the less specifically scoped color for X rather than the background.
There was no real logic behind the previous design other than to treat all color blending the same and it would cause a problem for 1.x themes using transparency for selection or invisible characters.
Closes issue #285.