halostatue/color — pull request #5 by armahillo (2014-04-15 05:24:45+00:00)
Title: Adds closest_match functions for color matching among RGB colors. 

Given an RGB object instantiation, you can pass an array of other RGB objects to the "closest_match" method, and it will identify the which of the colors is the closest match, based on L*a*b* analysis color distance. (This uses the CIE94 formula. There is a newer CIEDE2000 formula, but it uses some math functions I'm not sure how to do in Ruby. CIE94 is pretty solid.)

I had to add a to_lab function to handle the initial conversion. It's pretty basic, just returning a Hash (keys: :L, :a, :b) with the calculated values.

There is test coverage for all created methods.