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[
^]
http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/4126a010-6885-4eb0-b79c-c798c90edb85[
^]
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...