Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-04-2007, 11:00 PM   PM User | #1
Dr-Leech
New Coder

 
Join Date: Aug 2002
Location: Argentina
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Dr-Leech is an unknown quantity at this point
Calculate Color Proximity

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
Dr-Leech is offline   Reply With Quote
Old 08-05-2007, 01:59 AM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,056
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Take a look at this:
http://webscripts.softpedia.com/scri...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?
mlseim is offline   Reply With Quote
Old 08-05-2007, 02:04 AM   PM User | #3
Dr-Leech
New Coder

 
Join Date: Aug 2002
Location: Argentina
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Dr-Leech is an unknown quantity at this point
Thank you, I'll check this.
Dr-Leech is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:10 AM.


Advertisement
Log in to turn off these ads.