Re: [R] Drawing a colour wheel - bug in hcl?

From: hadley wickham <h.wickham_at_gmail.com>
Date: Mon, 07 Jul 2008 14:47:05 -0500

On Mon, Jul 7, 2008 at 1:05 PM, Earl F. Glynn <efg_at_stowers-institute.org> wrote:
> "hadley wickham" <h.wickham@gmail.com> wrote in message
> news:f8e6ff050807070906y272bf4b9u7a356a5da0850653_at_mail.gmail.com...
>> there's some
>> oddly bright colours of the wrong hue around c(0, 0) and I see three
>> coloured circles (a small magenta, a medium sized yellow and a large
>> cyan). Am I doing something wrong or is there a bug in the hcl code?
>
> You set c = 70 = constant
>
> from ?hcl:
>
> c The chroma of the color. The upper bound for chroma depends on hue
> and luminance
>
>
> You seem to have used the full range of possible hue and luminance values.
> Perhaps your odd colored circles are violations on valid values of chroma?

Well, I do have fixup = FALSE, which the documentation indicates should return NA if the chroma exceeds the actual upper bound.

> Also, using "hcl" in different ways in the same code is also discouraged by
> "Code Complete 2". Again on p. 287: "Avoid the names of standard types,
> variables, and routines." If "hcl" is a "standard" routine, using "hcl" as
> a variable name in the same code example using the "hcl" function is not
> recommended and is confusing.

Yes, that's true!

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 07 Jul 2008 - 19:50:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Jul 2008 - 22:31:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive