ColorBot formats allow you to customize how ColorBot displays and copies color information.
ColorBot uses patterns to determine how a color is displayed and copied to the clipboard. Each patterns can specify a separate format for display and for the clipboard.
These patterns contain special formatting tokens which Colorbot replaces with components of the color. Formatting tokens are surrounded by |'s. Tokens are specified by |format_type-component|. Here's an example:
This pattern is what colorbot uses for it's default RGB clipboard format. In fact, all of ColorBot's built in format's are specified as format strings like this.
The allowed values for type are hex, rgb, percent, and decimal. Component is r, g, or b (note: hex also supports uppercase R, G, or B for uppercase).
So, for uppercase hex (e.g #F0F0F0), the pattern would be:
ColorBot also supports HSL color formats, use the hsl type and h, s, or l for the component. e.g. |hsl-h|.
You can also use the |name| token to insert the user specified color name into your formats. This can be useful for creating css selector formats.
Make custom formats for pasting into code. Let say you have an UIColor subclass, MyColor, you'd like to make a format for. Make a new format in the color formats editor window and for the clipboard pattern, enter:
[[[MyColor alloc] initWithRed:|decimal-r| green:|decimal-g| blue:|decimal-b| alpha:1] autorelease]
Set this format as the active format by selecting it in the Active Format popup list on the editor window, or from the Color > Color Formats menu. Now, anytime you click on a color swatch in ColorBot, your custom MyColor initializer will be put onto the clipboard, ready for your code.