Bug 16426 - Add support for short hexadecimal colors
Summary: Add support for short hexadecimal colors
Alias: None
Product: R
Classification: Unclassified
Component: Wishlist (show other bugs)
Version: R-devel (trunk)
Hardware: x86_64/x64/amd64 (64-bit) Linux-Debian
: P5 enhancement
Assignee: R-core
Depends on:
Reported: 2015-06-15 15:26 UTC by xavier nayrac
Modified: 2015-07-01 09:23 UTC (History)
1 user (show)

See Also:

short hexadecimal colors (1.67 KB, patch)
2015-06-15 15:26 UTC, xavier nayrac
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description xavier nayrac 2015-06-15 15:26:29 UTC
Created attachment 1845 [details]
short hexadecimal colors

Hello everybody, I'm new in R and here.

This diff adds the support for short hexadecimal colors. So:

    plot(x, col='#ABC')

will be the same as:

    plot(x, col='#AABBCC')

I think it's a convenient shortcut. What do you think?

Xavier Nayrac
Comment 1 Duncan Murdoch 2015-06-22 11:17:34 UTC
Comment on attachment 1845 [details]
short hexadecimal colors

These shorthand color specs are used in CSS.  I don't see this as a high priority, but I'd consider a patch to implement it.  Your current patch has some problems though:

 - You should use "svn diff" to produce the patch, so we know which version of which files you've used
 - You shouldn't edit the whitespace in the files, or make other changes unrelated to the change.
 - You need to update the documentation as well.  I expect you'll need to edit the help pages for par() and col2rgb() and possibly others.
Comment 2 xavier nayrac 2015-07-01 09:23:48 UTC
It's cleary low priority.

- I'll use svn for the patch.
- I'll remove unrelated changes. But I am just curious: when and how do you improve the code, i.e do you make a patch just for whitespaces, newlines, etc?
- I'll update the documentation as well.

Thank you for the feedback ;)