Posted in Inside TFG
I’m frequently amazed at the work done by our design team, and where possible I try to do pixel perfect implementations of their designs. When designing an iOS application in Photoshop our designers often build a colour swatch that incorporates the client’s branding and the colour scheme intended for the application. Instead of importing these colours manually I recently investigated how to import a Photoshop colour swatch into XCode .
- Create a colour swatch in Photoshop, naming the colours appropriately (these names will be visible in XCode).
- Use the swatch menu to save the Swatches for Exchange (This saves the swatch using the Adobe Swatch Exchange format (ase). Note, the filename dictates the palette name in XCode.
- Clone, build, and install the excellent SwatchInstall.app by Ramon Poca. Note, the other command line tools in this package are not required.
- Start SwatchInstall.app and drag and drop the ase file onto it.
- Restart XCode.
That’s it! Your colour palette is now be available in XCode.
Behind the scenes SwatchInstall.app converts the ase format into clr and copies the result into ‘~/Library/Colors’.
If you wish to update a color palette simply drag a new version of the ase file onto SwatchInstall.app and restart XCode .
If you wish to a remove a colour palette, delete the file from ‘~/Library/Colors’ and restart XCode.
 The colour palettes available in XCode are actually imported from the operating system. If you move a project between computers the palette will not be available unless it has been imported on that machine.