Raghav
You could accomplish this using an enumeration combined with conditional visibility in your document template. For example, if you have an enumeration with values red, yellow and blue, you could have a 3 containers (or text elements) in your document template with styling that indicates background color or text color of each container. Then you could place these in rows in a table and make each row conditionally visible based on the enumeration value. This would be very tedious if you have a large number of colors, but it is do-able.
Hope that helps,
Mike