[TxMt] Re: showing preview of css colors

Allan Odgaard mailinglist at textmate.org
Mon May 30 11:19:37 UTC 2016

On 26 May 2016, at 22:21, Jacob Carlborg wrote:

> According to the UTCoreTypes.h header file in the LaunchServices 
> framework in the CoreServices framework SVG is supported since OS X 
> 10.10.

This would appear to be only as an UTI definition, i.e. NSImage can’t 
actually load these, although QuickLook actually can (but possibly via a 

> But to be sure you should call the "imageTypes" class method on 
> NSImage.

EPS is there, which is a vector format with a textual representation, so 
possible to generate from any scripting language without the use of any 
image libraries.

But rather than read the EPS/PS standard I cheated and saved a blue 
square with a black border from Sketch and looked at the source and it 
looks like gibberish :) but a lot of it seemed to be (possibly 
unnecessary) boilerplate.

I did test it with mate’s `--set-mark` and it works fine (I changed 
`GutterView.mm` to just draw the image rather than create a mask, so 
that we get color). Though I wouldn’t want this change for all images, 
I suggest including “Color” in the image name to indicate that it is 
not a mask (although this is opposite of the OS where a “Template” 
suffix indicates that it is monochrome image, but if we make this 
change, we have to change all existing uses of `--set-mark`).

I also added a new `callback.document.did-open` so that colors can be 
added during load instead of only during save (available starting with 
2.0-beta.9.3) — this also benefits the SCM Diff Gutter bundle where it 
has always annoyed me that the marks didn’t appear until first save.

More information about the textmate mailing list