[TxMt] Three easy TM for HTML questions

Allan Odgaard throw-away-1 at macromates.com
Mon Jan 23 01:32:53 UTC 2006


On 10/1/2006, at 23:08, Eric O'Brien wrote:

> [...] drag the color from the large sample area into your TextMate  
> document.
> The hex value of the color is inserted in your document.
>
> I wish there was a way to get other color specs in, like "rgb 
> (155,213,055)"

There actually is (but it's only documented in the pre 1.0.2 release  
notes):

    Colors (e.g. from color pickers) can now be dragged onto the
    text area. TextMate will run the command with the
    OakTextViewPrettyPrintColorCommand preferences key and as
    standard input provide the RGB value as three space delimited
    floating point numbers (from 0.0 to 1.0). The default command
    is: awk '{printf("#%02x%02x%02x", $1*255, $2*255, $3*255)}' --
    the normal TM variables are available, so in theory one could
    make the command check the file extension and format the color
    accordingly.






More information about the textmate mailing list