In the computer age, it's easy as pie. Use color-coded tags, and an LCD to display the price for each color code. Each size could be priced down to the penny.
The only problem, as you've hinted, is that it seems so damned petty.
It is petty with millions of pieces of clothes. I just hope Dillard's wasn't charging a white person and a black person with the same kind of hair, different prices.
You and I know that Nike knows the cost difference between a size 8 and size 12...and they average it.
This could happen with everything. In fact, some feel DRM (digital rights management) is leading toward a more perfect (from an ecomomist POV) world, where we can all pay different prices for DVD's. Those of us who would only watch a bought DVD 5x would pay one price, and one who would watch 100x would pay another.
Sometimes too much, is too much. I think we need to stick to basics.