Re: [R] hcl()

From: Robin Hankin <r.hankin_at_noc.soton.ac.uk>
Date: Fri 24 Jun 2005 - 20:32:49 EST

Professor Ripley

thanks for this.

>>

>> plot(1:50,pch=16,col=hcl(h=240, c=50, l=1:50))
>>
>> I get mostly blue, but also some red, dots. Note that h=240
>> throughout. If 240 is blue,
>> how come there's a red dot there? Or is it just my monitor?
>

>> hcl(h=240, c=50, l=1:50, fixup=F)
> [1] NA NA NA NA NA NA NA
> [8] NA NA NA NA NA NA NA
> [15] NA NA NA NA NA NA NA
> [22] NA NA NA NA NA NA NA
> [29] NA NA NA NA NA NA NA
> [36] NA NA NA "#08628E" "#126490" "#196693"
> "#1F6995"
> [43] "#246B97" "#286E9A" "#2D709C" "#31729F" "#3575A1" "#3877A4"
> "#3C7AA6"
> [50] "#3F7CA9"
>
> You have mainly used invalid values: you cannot have high chroma and
> low luminance (and there are warnings to that effect on the help
> page).
>
> Not sure the chosen mapping of out-of-gamut specs onto the sRGB gamut
> is particularly helpful, though.
>

Yes, this is what I was missing: with fixup taking its default value of TRUE, out-of-range combinations are silently mapped to real RGB values, [although the description of argument fixup in the manpage conveys this information to me only now that I have   your example above to look at].

  If I understand your comment, my odd-looking colours are a result of this mapping.

So, how best to determine the maximum chroma for a given luminance and hue?

--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Jun 24 20:37:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:02 EST