In a very general way and for the most common of deities the choice of colours is informed by the Four Tantric Activities which are also associated with four colours. White is for peaceful deities, yellow for deities of increase. Red for powerful deities and blue/black for wrathful deities. These four activities are also related to human emotions and the strength of intention in the application of meditation and ritual practice.
Peaceful activities include abstract concepts such as love, compassion, calmness, along with material benefits such as long-life and the curing of certain illnesses and disease. Associated white coloured figures are Chaturbhuja Lokeshvara and White Tara.
Increasing activities are, for example, the promotion of wealth, learning, and wisdom. Examples are Arapachana Manjushri, Jambhala, Vasudhara and Vaishravana.
Powerful activities are subduing, overcoming, the powerful acquisition of wealth, power or learning. Examples are Kurukulla, Maharakta Ganapati and Takkiraja.
Wrathful activities are for completely overcoming obstacles and hindrances. Examples are Krodha Vajrapani, Ekajati, Mahabala, Vignantaka and Mahakala.
There are several key topics of discussion regarding the relationship between colours and deities. The first is the  Four Tantric Activities,  Three Types of Deity Appearance and  Primary Deity Function and Colour.
The first topic is the Tantric System of the Four Activities. These are the four principal activities of Tantric Buddhism and each has a corresponding colour. 1. Peaceful-white, 2. Increasing-yellow, 3. Powerful-red, and 4. Wrathful-black. An example of a peaceful deity is white Avalokiteshvara. An example of an increasing deity is yellow Jambhala. An example of a powerful deity is red Kurukulla. An example of a wrathful deity is Mahakala. Green, while not included in the Four Activities, is regarded as the combination of all of the colours and all activities. There are also a variety of other deity colours but those are much less in number and often of a Tibetan origin rather than an Indian Buddhist origin. (See the Four Activities and Prayer Beads).
Buddhist Tantric theory within a Tibetan context divides the various source literature, teachings and technical ritual practices into four categories of profundity: performance (kriya), action (charya), union (yoga) and ultimate union (yoganiruttara).
The majority of the deities that belong to the first two categories of Tantra, performance and action, also called the two lower tantras, generally follow the colour scheme of the Four Activities Those deities are also confined or limited by their colour activity and do not engage in activities ourtside of that colour. The deities of the ultimate union Tantra category are far more complex in their depth of Tantric theory. Each of these deities are a composite of all Five Buddha Families.
The Five Buddha Families primarily belong to the union and highest union categories of Tantra. Five colours, with the addition of green added to the four basic colours, are used to distinguish the Five Buddhas and their placement in the center and four quadrants of a mandala. There are however, as with many other topics, exceptions to this system. The most common arrangement of Buddhas is as follows: Vairochana-center-white, Akshobhya-east-blue, Amitabha-west-red, Ratnasambhava-south-yellow, and Amoghasiddhi-north-green. The highest union tantra deities employ all four activities and are not limited in any way by colour or deity appearance.