i dont know if this scenario is exactly what you need, or you are just giving an example of what you want,
for this case you might need something like a string split function, once you have your values you will be comparing those with color id. you can write procedures etc to get that. but this only make things bigger and complex... may be your actual solution worth the complexity or not...
here are some links, how to do it.
An Easy But Effective Way to Split a String using Transact-SQL
once you have your string as record, you can use them like
select * from color_table where color id in (select * from split_result)
split result = complete logic of your splitting method...