...

View Full Version : Calculate Color Proximity



Dr-Leech
08-04-2007, 11:00 PM
Hi,

I want to compare 1 color (hex or rgb) with a list of colors and choose the more similar of the list.

For example I have #FF1202 and an array with:

array ("FF0000", "00FF00", "0000FF" ...);

I need to find the color more similar in the list (in this case the first: FF0000).


Anyone has an idea?

Thanks

mlseim
08-05-2007, 01:59 AM
Take a look at this:
http://webscripts.softpedia.com/script/PHP-Clases/WebSafeColors-inc-php-20381.html

Download the example and script and see if you can use it.
I think it not only lets the user know if their color is "safe" or not,
but also provides the nearest safe color ... similar to what you are doing?

Dr-Leech
08-05-2007, 02:04 AM
Thank you, I'll check this. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum