Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Michael Friendly
Sent: Saturday, June 01, 2013 11:33 AM
To: John Fox
Cc: 'r-help'; 'Martin Maechler'
Subject: Re: [R] measuring distances between colours?
Just a quick note: The following
10:43 AM
To: John Fox
Cc: r-help; Michael Friendly; Martin Maechler
Subject: Re: [R] measuring distances between colours?
Sorry about the bug. How embarrassing. Especially because I've learned
over
the years to trust my gut feelings when something doesn't feel quite
right,
and when I
] measuring distances between colours?
Thanks for the discussion. I've also wanted to be able to find nearest
colors. I took the code and comments in this thread and simplified the
function even further. (Personally, I think using closures results in
Rube-Goldberg code. YMMV.) The first example
Hi Michael,
Thanks for the Wikipedia tip -- I'd looked there but didn't find this
article. The article explains that the Lab colour space was formulated to
provide uniform perceptual differences between colours, with a JND of
approximately of 2.3. Ken Knoblauch made a similar point. The article
Hi John,
Out of curiosity and if it is not much trouble, I would be curious if Luv
worked any better than Lab. I think that Luv is supposed to be preferred for
monitors and Lab for surfaces but they are generally pretty similar.
Best,
Ken
Sent from my iPhone
___
Ken Knoblauch
Inserm U846
: Saturday, June 01, 2013 11:33 AM
To: John Fox
Cc: 'r-help'; 'Martin Maechler'
Subject: Re: [R] measuring distances between colours?
Just a quick note: The following two versions of your function don't
give the same results. I'm not sure why, and also not sure why the
criterion for 'near
-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Ken Knoblauch
Sent: Saturday, June 01, 2013 12:18 PM
To: John Fox
Cc: r-help@r-project.org; Michael Friendly; Martin Maechler
Subject: Re: [R] measuring distances between colours?
Hi John,
Out of curiosity
Hi John
I agree that the Lab representation is the best so far for the goal of
perceptually
similar colors, and the approximate JND of
2.3 on the distance scale in this space is a useful, non-arbitrary
criterion.
FWIW, your demo might better show the hex and color names adjacently,
for
: Saturday, June 01, 2013 12:18 PM
To: John Fox
Cc: r-help@r-project.org; Michael Friendly; Martin Maechler
Subject: Re: [R] measuring distances between colours?
Hi John,
Out of curiosity and if it is not much trouble, I would be curious if
Luv worked any better than Lab. I think that Luv
] measuring distances between colours?
Dear John,
John Fox j...@mcmaster.ca on Thu, 30 May
2013 08:13:19 -0400 writes:
Dear r-helpers, I'm interested in locating the named
colour that's closest to an arbitrary RGB colour.
Hmm, maybe I was not really
John Fox j...@mcmaster.ca
on Thu, 30 May 2013 17:14:06 -0400 writes:
Dear all,
My thanks to everyone who addressed my question. I've
incorporated Eik Vettorazzi's suggestion for improved
conversion of hexadecimal RGB colours to decimal numbers,
and Martin
Hi John
This has been an interesting discussion.
Though you have a solution for your needs, you might be interested in
this javascript implementation that allows you to visually compare color
distances in various color spaces
http://stevehanov.ca/blog/index.php?id=116
And, all the theory of
Thanks for the discussion. I've also wanted to be able to find nearest
colors. I took the code and comments in this thread and simplified the
function even further. (Personally, I think using closures results in
Rube-Goldberg code. YMMV.) The first example below is what I use for
'group'
.
Best,
John
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Kevin Wright
Sent: Friday, May 31, 2013 3:39 PM
To: Martin Maechler
Cc: r-help; John Fox
Subject: Re: [R] measuring distances between colours?
Thanks
Dear r-helpers,
I'm interested in locating the named colour that's closest to an arbitrary
RGB colour. The best that I've been able to come up is the following, which
uses HSV colours for the comparison:
r2c - function(){
hexnumerals - 0:15
names(hexnumerals) - c(0:9, LETTERS[1:6])
On 05/30/2013 10:13 PM, John Fox wrote:
Dear r-helpers,
I'm interested in locating the named colour that's closest to an arbitrary
RGB colour. The best that I've been able to come up is the following, which uses HSV
colours for the comparison:
r2c- function(){
hexnumerals- 0:15
John Fox jfox at mcmaster.ca writes:
I'm interested in locating the named colour that's closest to an
arbitrary RGB colour. The best that I've
been able to come up is the following, which uses
HSV colours for the comparison:
r2c - function(){
hexnumerals - 0:15
names(hexnumerals)
Hi Jim,
Thanks for this.
Ben's function makes comparisons in the RGB rather than the HSV colour space;
works on the decimal rather than hex representation of colours; applies to a
single colour rather than a vector; recomputes the CSV representation of the
named colours each time it's called
Dear Ken,
Yes, that's the paper I was trying to remember, along with the associated
spaces. I'll probably get a better solution using the colorspace package.
Thanks,
John
On Thu, 30 May 2013 12:36:11 +
Ken Knoblauch ken.knobla...@inserm.fr wrote:
John Fox jfox at mcmaster.ca writes:
Dear John,
John Fox j...@mcmaster.ca
on Thu, 30 May 2013 08:13:19 -0400 writes:
Dear r-helpers,
I'm interested in locating the named colour that's closest to an
arbitrary RGB colour.
Hmm, maybe I was not really marketing well enough
what I had added for R 3.0.0 :
John Fox j...@mcmaster.ca
on Thu, 30 May 2013 08:51:10 -0400 writes:
Dear Ken,
Yes, that's the paper I was trying to remember, along with the associated
spaces. I'll probably get a better solution using the colorspace package.
I'm not sure.
Some of the colorspace package
Hi John,
i would propose a one-liner for the hexcode transformation:
hex2dec-function(hexnums)sapply(strtoi(hexnums,16L),function(x)x%/%256^(2:0)%%256)
#instead of
hexnumerals - 0:15
names(hexnumerals) - c(0:9, LETTERS[1:6])
hex2decimal - function(hexnums){
hexnums - strsplit(hexnums, )
Dear Martin,
-Original Message-
From: Martin Maechler [mailto:maech...@stat.math.ethz.ch]
Sent: Thursday, May 30, 2013 9:18 AM
To: John Fox
Cc: r-help@r-project.org
Subject: Re: [R] measuring distances between colours?
Dear John,
John Fox j...@mcmaster.ca
on Thu, 30 May
-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Eik Vettorazzi
Sent: Thursday, May 30, 2013 9:33 AM
To: John Fox
Cc: r-help@r-project.org
Subject: Re: [R] measuring distances between colours?
Hi John,
i would propose a one-liner for the hexcode
...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of John Fox
Sent: Thursday, May 30, 2013 8:13 AM
To: r-help@r-project.org
Subject: [R] measuring distances between colours?
Dear r-helpers,
I'm interested in locating the named colour that's closest to an
arbitrary RGB colour
25 matches
Mail list logo