Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Argentina
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,493
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    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?

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    Argentina
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, I'll check this.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •