[TxMt] Do we really need a Color/Font Picker?

Hans-Joerg Bibiko bibiko at eva.mpg.de
Wed Aug 1 13:30:32 UTC 2007


Hi,

I just thought about a color picker in tm_dialog.
But do we need it?

Background:
I simply added to TextMate's MainMenu.nib Menu the following:
Format
	Font
		Show Fonts
		Show Colors
	Text
		Align Left
		Center
		Justify
		Align Right

without key bindings.

If I invoke 'Show Colors' in TM a color palette will be displayed, I  
can choose a color, and finally I can drag&drop the color which is  
shown in the rectangle to a document in TM, and I get e.g. #FF33DC.  
This should work for HTML, CSS, etc. stuff properly.
The same for Show Fonts. I can drag&drop the name for instance.

All items under Format>Text also work but with the limitation that  
all commands interact only with the current size of the document's  
window.
[This, of course, is ONLY a side note ;)]

OK.

If someone needs a tm_dialog nib which asks the user, among others,  
to choose some colors, one could such a nib by using NSColorWell easily.
I wrote a routine for tm_dialog to parse the result dictionary for  
NSColor objects. If there are some the routine will replace the  
content of these dictionary's keys with an array containing the  
following strings:
{example for red; 'color' is the selection value in the nib}
<key>color</key>
<array>
	<string>#FF0000</string>
	<string>255 0 0</string>
</array>

Each programming language I know can use at least one of the color's  
representation for further calculations. It would be easy to add also  
the values for the HSB and CMYK models.

So my question is:
Is there something which I didn't consider?

Regards,

Hans



More information about the textmate mailing list