Suppose you have a database table named 'companies' with these fields
companies_id
companies_name
* companies_colour
You could find all the companies of a given colour by this query:
SELECT * FROM companies WHERE companies_colour='PURPLE';
That would return all the records in the companies table who set their colour to 'purple'.
Sounds to me like your system would require additional tables for members, messages, etc. The messages table might be something like
messages_id
messages_colour
messages_companies_id
messages_subject
* messages_contents
If someone composed a message with color purple, you could use the above query to return all the companies with colour purple and then create a record in the messages table for each company returned -- each being identical except for the messages_companies_id which is how you assign the message record to a particular company. This approach would have a lot of redundant information but it would be simple.
You could also try creating a messages_to_companies table that just has
messages_id
companies_id
where you connect a message to a particular company. this would eliminate that redundancy.