Re: Color closest to color
Re: Color closest to color
- Subject: Re: Color closest to color
- From: "Mills, Steve" <email@hidden>
- Date: Tue, 17 Jun 2014 13:14:54 +0000
- Thread-topic: Color closest to color
On Jun 17, 2014, at 06:43:54, Maxthon Chan <email@hidden> wrote:
> One easy-to-implement method: colour cube.
>
> Define a colour using its RGB values as a 3-tuple (r, g, b) and standard colours (ri, gi, bi) (where i = 0..n).The square distance between the given colour and a standard colour is (ri-r)^2+(gi-g)^2+(bi-b)^2. You can calculate square distances between the given colour and each of the standard colours, and the one with the minimal squared distance is the best match.
The algorithm I've seen then takes the square root of that value.
--
Steve Mills
office: 952-818-3871
home: 952-401-6255
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden