Set a background color per image added to a post

You can store the chosen color in a meta field. We have a question about adding a custom field to attachments, it contains an example. The hooks you need are attachment_fields_to_edit and attachment_fields_to_save.